Skip to main content
Glama

Validate a Nigerian postcode

validate_postcode
Read-onlyIdempotent

Check a Nigerian postcode's structure offline and return its canonical forms and segments. Does not verify building assignment; use lookup_postcode for that.

Instructions

Check a Nigerian postcode's structure offline; 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

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

Output 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. Changed1 schema field changedv0.4.5
    • addedInput schema / properties / postcode / maxLength
      Added value: +64
  2. First observedv0.2.4

TDQS

A4.5/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; the description reinforces this by advertising offline, instant operation and, more importantly, discloses the key limitation that structural validity does not imply an assigned building. It does not describe behavior on malformed input (e.g. error vs. empty result), which is a minor remaining gap.

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?

Two short sentences: the capability first, then the important caveat and the routing alternative. No filler, nothing that could be trimmed without losing information.

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

Completeness5/5

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

With an output schema present, the description needn't explain return values, and it covers the scope of validity (structural, not assignment) and the routing decision. For a single-parameter read-only validator, nothing an agent needs to call it correctly is missing.

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?

There is a single parameter whose schema description coverage is 100%, including the 'any style' example format, so the schema already carries the semantics. The description adds nothing about accepted input forms beyond what the schema provides, 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 Nigerian postcode's structure offline') plus what it returns ('canonical forms and segments'). It explicitly contrasts itself with the sibling lookup_postcode, so an agent can distinguish structural validation from assignment lookup.

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?

Names the alternative tool explicitly and the condition that selects it ('Does not confirm the code is assigned to a building; use lookup_postcode for that'). It also signals the cost/availability profile ('Free and instant'), which helps an agent prefer this validator before a heavier lookup.

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