Skip to main content
Glama
dwain-barnes

MCP Server Police UK

by dwain-barnes

get_last_updated

Get the date when UK crime data was last updated to ensure you are using current information from police forces across England, Wales, and Northern Ireland.

Instructions

Retrieve the date when crime data was last updated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function `getLastUpdated()` that calls the 'crime-last-updated' API endpoint and returns the date string.
    async function getLastUpdated() {
      const data = await makeApiRequest('crime-last-updated');
      return data?.date || '';
    }
  • The tool definition/schema for 'get_last_updated' including name, description, and empty inputSchema (no parameters).
    {
      name: 'get_last_updated',
      description: 'Retrieve the date when crime data was last updated',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • src/index.ts:447-469 (registration)
    The toolFunctions mapping that registers 'get_last_updated: getLastUpdated' so the CallToolRequestSchema handler can dispatch to it.
    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
    };
  • The `makeApiRequest` helper function used by getLastUpdated to call the 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;
      }
    }
Behavior3/5

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

No annotations, so description carries full burden. States it is a retrieval, implying read-only, but does not mention return format or side effects. Adequate for a simple tool but lacks details.

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?

Single sentence with 8 words, no redundancy. Extremely concise and well-structured.

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

Completeness3/5

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

Given no parameters, no output schema, and no annotations, description is minimal. Could specify the output format, but is adequate for a simple metadata retrieval.

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?

No parameters exist, and schema coverage is 100%. Description adds no parameter info, which is acceptable, baseline 3.

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?

Description clearly states it retrieves the last updated date of crime data, using a specific verb and resource. Differentiates from siblings which retrieve crime records themselves.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternatives guidance, but the tool is self-explanatory. Usage is implied for checking data freshness.

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