get_stop_searches_no_location
Retrieve stop and search records that have no mapped location for a given police force and optional month.
Instructions
Retrieve stop and searches that could not be mapped to a location
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force_id | Yes | The unique identifier for the force | |
| date | No | Specific month (YYYY-MM) |
Implementation Reference
- src/index.ts:432-437 (handler)Handler function for get_stop_searches_no_location: extracts force_id and date, builds params with force mapped from force_id, calls makeApiRequest on 'stops-no-location' endpoint.
async function getStopSearchesNoLocation(args: any) { const { force_id, date } = args; const params: Record<string, any> = { force: force_id }; if (date) params.date = date; return await makeApiRequest('stops-no-location', params) || []; } - src/index.ts:245-256 (schema)Input schema registration for get_stop_searches_no_location: defines required force_id (string) and optional date (string) parameters.
{ name: 'get_stop_searches_no_location', description: 'Retrieve stop and searches that could not be mapped to a location', 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-469 (registration)Tool function mapping registration: maps the tool name 'get_stop_searches_no_location' to the handler function getStopSearchesNoLocation.
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 }; - src/index.ts:9-19 (helper)Helper function makeApiRequest used by the handler to make HTTP GET requests to the police.uk API.
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; }