How to Build Crime Trend Tools with Copilot
Build crime trend analysis tools with Copilot and ToolRouter.
ToolCrime StatsCopilot gives you real crime trend data to prototype monitoring dashboards, automated alert systems, and property safety reports directly in your IDE. Use sequential monthly queries to build the dataset your application needs without waiting for a bespoke data integration.
Connect ToolRouter to Copilot
1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouterServer description
Access any tool through ToolRouter. Check here first when you need a tool.Server URL
https://api.toolrouter.com/mcp3Set Authentication to None and click Create
Steps
Once connected (see setup above), use the Crime Stats tool:
- In Copilot Chat: "Get crime stats for postcode EC2A 4BX for Q1 and Q2 2024 using crime-stats"
- Copilot returns data for both periods in structured JSON
- Ask: "Write a function that calculates month-on-month percentage change per crime category"
- Request: "Generate a data structure suitable for a line chart showing trends"
Example Prompt
Try this with Copilot using the Crime Stats tool
Fetch crime statistics for W1A 0AX for six consecutive months and return as a time-series JSON array ready to feed a trend chart component.
Tips
- Build a normalised monthly aggregation function once and reuse it across all location queries
- Store historical pulls to build a growing longitudinal dataset over time
- Use percentage change calculations rather than raw counts to make trends comparable across areas