get_neighbourhood_details
Retrieve detailed information about a specific neighbourhood, including team members and priorities, by providing force and neighbourhood IDs.
Instructions
Retrieve details for a specific neighbourhood within a force
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:372-376 (handler)The handler function for 'get_neighbourhood_details'. It extracts force_id and neighbourhood_id from args, constructs the API endpoint as `${force_id}/${neighbourhood_id}`, calls the police.uk API, and returns the result or an empty object.
async function getNeighbourhoodDetails(args: any) { const { force_id, neighbourhood_id } = args; const endpoint = `${force_id}/${neighbourhood_id}`; return await makeApiRequest(endpoint) || {}; } - src/index.ts:148-159 (schema)Input schema definition for 'get_neighbourhood_details' tool. Requires 'force_id' (string) and 'neighbourhood_id' (string) as input parameters.
{ name: 'get_neighbourhood_details', description: 'Retrieve details for a specific neighbourhood within a force', 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:447-459 (registration)Registration mapping that links the tool name 'get_neighbourhood_details' to its handler function getNeighbourhoodDetails in the toolFunctions object.
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, - src/index.ts:9-20 (helper)The helper function makeApiRequest used by getNeighbourhoodDetails to call the police.uk API at https://data.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; } }