Skip to main content
Glama
dwain-barnes

MCP Server Police UK

by dwain-barnes

get_crime_categories

Obtain valid crime categories for a specified month to filter police.uk crime data accurately. Use this before querying street-level crimes to ensure correct category inputs.

Instructions

Retrieve valid crime categories for a given date

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoSpecific month (YYYY-MM)

Implementation Reference

  • The handler function for get_crime_categories. Calls the police.uk API endpoint 'crime-categories' with an optional date parameter.
    async function getCrimeCategories(args: any) {
      const { date } = args;
      const params = date ? { date } : {};
      return await makeApiRequest('crime-categories', params) || [];
    }
  • Input schema definition for get_crime_categories. Accepts a single optional 'date' parameter (YYYY-MM format).
    {
      name: 'get_crime_categories',
      description: 'Retrieve valid crime categories for a given date',
      inputSchema: {
        type: 'object',
        properties: {
          date: { type: 'string', description: 'Specific month (YYYY-MM)' }
        }
      }
    },
  • src/index.ts:452-452 (registration)
    Registration of get_crime_categories in the toolFunctions mapping, connecting the tool name to its handler function.
    get_crime_categories: getCrimeCategories,
  • The makeApiRequest helper function used by getCrimeCategories 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;
      }
    }
Behavior2/5

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

With no annotations, the description is the sole source of behavioral info. It only mentions retrieval but does not disclose any side effects, error handling, or rate limits. Minimal transparency.

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?

The description is a single concise sentence, front-loaded with the action and resource. No wasted words.

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?

For a simple retrieval tool with no output schema, the description is adequate but lacks any indication of the return format or behavior for invalid dates. It could be more complete.

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?

The schema describes the date parameter as 'Specific month (YYYY-MM)', and the description echoes 'for a given date'. With 100% schema coverage, baseline is 3; description adds no extra meaning.

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?

The description clearly states 'Retrieve valid crime categories for a given date', specifying the action, resource, and condition. It distinguishes from sibling tools that deal with crimes, forces, or locations.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives. Given the many sibling tools, the description should ideally advise when categories are needed, but it does not.

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