get_neighbourhood_team
Fetch the list of officers and staff assigned to a neighbourhood police team by specifying the force and neighbourhood IDs.
Instructions
Retrieve the team members 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:384-388 (handler)Handler function that executes the 'get_neighbourhood_team' tool logic. It extracts force_id and neighbourhood_id from args, builds the API endpoint as '{force_id}/{neighbourhood_id}/people', and calls makeApiRequest to fetch the team members from the police.uk API.
async function getNeighbourhoodTeam(args: any) { const { force_id, neighbourhood_id } = args; const endpoint = `${force_id}/${neighbourhood_id}/people`; return await makeApiRequest(endpoint) || []; } - src/index.ts:172-183 (schema)Input schema definition for the tool. Specifies that 'force_id' and 'neighbourhood_id' are required string properties used to identify the neighbourhood whose team members should be retrieved.
{ name: 'get_neighbourhood_team', description: 'Retrieve the team members 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:446-469 (registration)Tool registration in the toolFunctions mapping. Maps the tool name 'get_neighbourhood_team' to the handler function getNeighbourhoodTeam, which is invoked when the tool is called via the MCP CallToolRequestSchema handler.
// Tool function mapping 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-20 (helper)The makeApiRequest helper function that performs the actual HTTP GET request to the police.uk API (https://data.police.uk/api) with the provided endpoint and optional query parameters.
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; } }