get_neighbourhood_priorities
Retrieve current policing priorities for a specific neighbourhood by providing the force and neighbourhood identifiers.
Instructions
Retrieve policing priorities for a specific neighbourhood
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force_id | Yes | The unique identifier for the force | |
| neighbourhood_id | Yes | The unique identifier for the neighbourhood |
Implementation Reference
- src/index.ts:196-207 (schema)Schema definition for the 'get_neighbourhood_priorities' tool. Defines input params: force_id (required string) and neighbourhood_id (required string).
{ name: 'get_neighbourhood_priorities', description: 'Retrieve policing priorities for a specific neighbourhood', inputSchema: { type: 'object', properties: { force_id: { type: 'string', description: 'The unique identifier for the force' }, neighbourhood_id: { type: 'string', description: 'The unique identifier for the neighbourhood' } }, required: ['force_id', 'neighbourhood_id'] } }, - src/index.ts:396-400 (handler)Handler function for get_neighbourhood_priorities. Extracts force_id and neighbourhood_id from args, makes API call to '{force_id}/{neighbourhood_id}/priorities', returns the result or empty array.
async function getNeighbourhoodPriorities(args: any) { const { force_id, neighbourhood_id } = args; const endpoint = `${force_id}/${neighbourhood_id}/priorities`; return await makeApiRequest(endpoint) || []; } - src/index.ts:463-463 (registration)Registration mapping the tool name 'get_neighbourhood_priorities' to the handler function getNeighbourhoodPriorities in the toolFunctions object.
get_neighbourhood_priorities: getNeighbourhoodPriorities, - src/index.ts:8-20 (helper)Helper function makeApiRequest used by getNeighbourhoodPriorities to call the police.uk API at 'https://data.police.uk/api'.
// Helper function to make API requests to police.uk 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; } }