Skip to main content
Glama
dwain-barnes

MCP Server Police UK

by dwain-barnes

get_street_level_crimes

Retrieve street-level crime data for any location in England, Wales, and Northern Ireland. Specify coordinates or a custom polygon area, filter by date and category, and get detailed crime records.

Instructions

Retrieve street-level crimes by lat/lng or custom polygon area

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latNoLatitude of the requested crime area
lngNoLongitude of the requested crime area
polyNoThe lat/lng pairs defining the boundary of the custom area
dateNoLimit results to a specific month (YYYY-MM)
categoryNoThe crime categoryall-crime

Implementation Reference

  • Handler function for 'get_street_level_crimes'. Extracts lat/lng/poly/date/category from args, builds query params, calls the police.uk API endpoint 'crimes-street/{category}' via the makeApiRequest helper, and returns the results or empty array.
    async function getStreetLevelCrimes(args: any) {
      const { lat, lng, poly, date, category = 'all-crime' } = args;
      const params: Record<string, any> = {};
      
      if (date) params.date = date;
      if (lat && lng) {
        params.lat = lat;
        params.lng = lng;
      } else if (poly) {
        params.poly = poly;
      } else {
        return [];
      }
      
      const endpoint = `crimes-street/${category}`;
      return await makeApiRequest(endpoint, params) || [];
    }
  • Schema registration for 'get_street_level_crimes' tool. Defines the name, description, and inputSchema with optional properties: lat (number), lng (number), poly (string), date (string), category (string, default 'all-crime').
      name: 'get_street_level_crimes',
      description: 'Retrieve street-level crimes by lat/lng or custom polygon area',
      inputSchema: {
        type: 'object',
        properties: {
          lat: { type: 'number', description: 'Latitude of the requested crime area' },
          lng: { type: 'number', description: 'Longitude of the requested crime area' },
          poly: { type: 'string', description: 'The lat/lng pairs defining the boundary of the custom area' },
          date: { type: 'string', description: 'Limit results to a specific month (YYYY-MM)' },
          category: { type: 'string', description: 'The crime category', default: 'all-crime' }
        }
      }
    },
  • src/index.ts:448-448 (registration)
    Tool function mapping that maps the tool name 'get_street_level_crimes' to the handler function getStreetLevelCrimes. Used at runtime by the CallToolRequestSchema handler to dispatch tool calls.
    get_street_level_crimes: getStreetLevelCrimes,
  • Helper function makeApiRequest that performs the actual HTTP GET request to the police.uk API base URL with the given endpoint and parameters. Used by the getStreetLevelCrimes handler to fetch crime data.
    async function makeApiRequest(endpoint: string, params?: Record<string, any>) {
      const baseUrl = 'https://data.police.uk/api';
      const url = `${baseUrl}/${endpoint}`;
      
      try {
        const response = await axios.get(url, { params, timeout: 10000 });
        return response.data;
      } catch (error) {
        console.error(`API request failed: ${error}`);
        return null;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description only says 'retrieve', lacking details on read-only behavior, data freshness, or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One short sentence is concise but could be expanded with more context without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 optional parameters, no output schema, and no annotations, the description is too brief to inform proper usage, missing details on poly format, date requirement, category values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds no extra value beyond what parameters already indicate. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieve', the resource 'street-level crimes', and the method by lat/lng or polygon, distinguishing it from siblings like get_crimes_at_location.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives, such as when to use lat/lng vs polygon, or what scenarios are appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dwain-barnes/police-uk-api-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server