Skip to main content
Glama
paulieb89

GOV UK Search

by paulieb89

Look Up UK Postcode

govuk_lookup_postcode
Read-onlyIdempotent

Retrieve administrative geography for any UK postcode, including local authority, constituency, and region, to direct users to the correct local service.

Instructions

Look up a UK postcode to retrieve its local authority, region, constituency, and other administrative geography.

Useful for determining which council area, parliamentary constituency, or NHS region a postcode falls within. Commonly used to direct users to the correct local service on GOV.UK (e.g. council tax, planning, waste).

Uses the postcodes.io public API (no key required).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
postcodeYesUK postcode, e.g. 'SW1A 2AA' or 'NG1 1AA'. Spaces optional.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
postcodeNoCanonicalised postcode as returned by postcodes.io.
latitudeNoLatitude in decimal degrees (WGS84).
longitudeNoLongitude in decimal degrees (WGS84).
countryNoCountry, e.g. 'England', 'Scotland', 'Wales', 'Northern Ireland'.
regionNoONS region, e.g. 'East Midlands'.
parliamentary_constituencyNoParliamentary constituency (pre-2025 boundary).
parliamentary_constituency_2025NoParliamentary constituency under the 2025 boundaries.
local_authorityNoLocal authority / council covering the postcode.
admin_countyNoAdministrative county, where applicable (null in unitary areas).
nhs_integrated_care_boardNoNHS Integrated Care Board, where available.
codesNoGSS codes for all administrative geographies covering this postcode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / params
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "PostcodeInput with a UK postcode (e.g. 'NG1 1AA', 'SW1A 2AA').",
      -  "properties": {
      -    "postcode": {
      -      "description": "UK postcode, e.g. 'SW1A 2AA' or 'NG1 1AA'. Spaces optional.",
      -      "maxLength": 8,
      -      "minLength": 5,
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "postcode"
      -  ],
      -  "type": "object"
      -}
    • addedInput schema / properties / postcode
      Added value: +{
      +  "description": "UK postcode, e.g. 'SW1A 2AA' or 'NG1 1AA'. Spaces optional.",
      +  "maxLength": 8,
      +  "minLength": 5,
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "params"
      -]New value: +[
      +  "postcode"
      +]
  2. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, and non-destructive. The description adds valuable context that it uses the postcodes.io public API with no key required, but does not mention rate limits or invalid input handling. This is sufficient for a simple read-only lookup.

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?

Three short, focused paragraphs with no redundancy. The first sentence gives the core operation, the second adds usage context, and the third provides a technical detail. Every sentence earns its place.

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

Completeness4/5

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

Given the tool's simplicity (one parameter, full schema coverage, output schema present), the description adequately covers what, when, and external API details. It could mention edge cases like invalid postcodes, but for a direct lookup this is sufficient.

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 provides 100% coverage of the single parameter, including format, length, and examples. The description adds little beyond what the schema already states, so the baseline of 3 applies.

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 states the action 'Look up' and the resource 'UK postcode' with specific outputs like local authority, region, and constituency. This clearly distinguishes it from sibling tools focused on content, organisations, or search.

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

Usage Guidelines4/5

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

It explicitly states when to use the tool ('Useful for determining which council area...') and gives practical examples like directing users to local services. However, it does not mention alternative tools or when-not-to-use, though no sibling tool offers postcode lookup.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.