Skip to main content
Glama
dwain-barnes

MCP Server Police UK

by dwain-barnes

get_stop_searches_by_force

Retrieve stop and search records reported by a specific UK police force using the force ID. Optionally filter by month (YYYY-MM) to narrow results.

Instructions

Retrieve stop and searches reported by a specific force

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
force_idYesThe unique identifier for the force
dateNoSpecific month (YYYY-MM)

Implementation Reference

  • The function that executes the tool logic for 'get_stop_searches_by_force'. It extracts force_id and optional date from args, builds query params, and calls the UK Police API 'stops-force' endpoint via makeApiRequest.
    async function getStopSearchesByForce(args: any) {
      const { force_id, date } = args;
      const params: Record<string, any> = { force: force_id };
      if (date) params.date = date;
      return await makeApiRequest('stops-force', params) || [];
    }
  • Input schema definition for the 'get_stop_searches_by_force' tool. Defines 'force_id' (required) and 'date' (optional, YYYY-MM) as input parameters.
    {
      name: 'get_stop_searches_by_force',
      description: 'Retrieve stop and searches reported by a specific force',
      inputSchema: {
        type: 'object',
        properties: {
          force_id: { type: 'string', description: 'The unique identifier for the force' },
          date: { type: 'string', description: 'Specific month (YYYY-MM)' }
        },
        required: ['force_id']
      }
    }
  • src/index.ts:447-468 (registration)
    Maps the tool name 'get_stop_searches_by_force' to its handler function getStopSearchesByForce in the toolFunctions object, which is used by the CallToolRequestSchema handler.
    const toolFunctions = {
      get_street_level_crimes: getStreetLevelCrimes,
      get_street_level_outcomes: getStreetLevelOutcomes,
      get_crimes_at_location: getCrimesAtLocation,
      get_crimes_no_location: getCrimesNoLocation,
      get_crime_categories: getCrimeCategories,
      get_last_updated: getLastUpdated,
      get_outcomes_for_crime: getOutcomesForCrime,
      get_list_of_forces: getListOfForces,
      get_force_details: getForceDetails,
      get_senior_officers: getSeniorOfficers,
      get_neighbourhoods: getNeighbourhoods,
      get_neighbourhood_details: getNeighbourhoodDetails,
      get_neighbourhood_boundary: getNeighbourhoodBoundary,
      get_neighbourhood_team: getNeighbourhoodTeam,
      get_neighbourhood_events: getNeighbourhoodEvents,
      get_neighbourhood_priorities: getNeighbourhoodPriorities,
      locate_neighbourhood: locateNeighbourhood,
      get_stop_searches_by_area: getStopSearchesByArea,
      get_stop_searches_by_location: getStopSearchesByLocation,
      get_stop_searches_no_location: getStopSearchesNoLocation,
      get_stop_searches_by_force: getStopSearchesByForce
  • Helper function makeApiRequest used by the handler to call the UK Police API at data.police.uk/api/{endpoint}.
    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;
      }
    }
Behavior3/5

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

Without annotations, the description carries full burden. It states that records are reported by a specific force, but does not disclose data freshness, pagination, error handling, or any behavioral traits beyond the basic operation.

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

Conciseness5/5

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

A single, efficient sentence with no unnecessary words. Every word serves a purpose.

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

Completeness4/5

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

For a simple retrieval tool with no output schema, the description is adequate. It might benefit from mentioning that the response is a list of records, but it covers the essential purpose well.

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 description coverage is 100%, so baseline is 3. The description does not add meaning beyond the schema's parameter descriptions, which are already clear.

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' and the resource 'stop and searches reported by a specific force', distinguishing it from sibling tools like get_stop_searches_by_area or get_stop_searches_by_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 versus alternatives. The description does not mention when not to use it or provide any context about other stop search tools.

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