Skip to main content
Glama

Validate a Nigerian postcode

validate_postcode
Read-onlyIdempotent

Checks a postcode's structure offline and returns its canonical forms and segments, without confirming it is assigned to a building.

Instructions

Check a postcode's structure offline and return its canonical forms and segments.

Free and instant. Does not confirm the code is assigned to a building; use lookup_postcode for that.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
postcodeYesCode in any style, e.g. 'ek 01 a03 fk 01'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorYesWhy the code is malformed.
validYesWhether the code is well formed. It may still be unassigned.
spacedYesForm shown to people, e.g. EK 01 A03 FK 01.
compactYesCompact form for storage, e.g. EK01A03FK01.
postcodeYesCanonical form, e.g. EK-01-A03-FK-01.
segmentsYes
suggestionYesA well-formed code if look-alike characters (O/0, I/1, S/5, B/8) were the only problem. Confirm it with the user before using it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.4

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so safety is covered. The description still adds value by disclosing that the check is offline and that it does not verify real-world assignment of the code — a semantic limit the annotations cannot express. It stops short of saying what happens on a malformed input (error vs. invalid result).

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 sentences, zero filler, with the core purpose and the cost/scope caveat front-loaded before the sibling pointer. 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?

An output schema exists, so return shapes need not be explained, and annotations cover the safety profile. Purpose, scope limit, and the alternative tool are all present; only the failure-mode behavior for an invalid postcode is left unstated.

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?

With one parameter at 100% schema description coverage, the schema already documents the input, including the any-style example. The description adds no format or normalization detail beyond the schema, so the baseline 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?

States a specific verb and resource ('Check a postcode's structure') plus what it returns ('canonical forms and segments'), and explicitly distinguishes itself from lookup_postcode. An agent can tell it apart from autocomplete_postcode or resolve_address without opening a schema.

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

Usage Guidelines5/5

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

Gives an explicit when-not ('Does not confirm the code is assigned to a building') and names the alternative to use instead ('use lookup_postcode for that'). It also frames the cost profile ('Free and instant'), which helps an agent prefer this over a heavier lookup.

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