Skip to main content
Glama

Validate a postal code

validate_postcode
Read-onlyIdempotent

Check whether a postal code has a valid format for a country and return its normalized form (uppercase, official space or hyphen), a format example and the country name. Example: country "NL", code "1234ab" → valid true, normalized "1234 AB". Format check only (Google libaddressinput patterns): it does not confirm the code exists or is deliverable. Countries without postal codes return valid false with reason "no_postal_codes". Read-only. Same engine as GET /v1/validate.

Input Schema

NameRequiredDescriptionDefault
codeYesThe postal code to check, e.g. "SW1A 1AA", "94103", "10115".
countryYesISO 3166-1 alpha-2 country code, e.g. "US", "GB", "DE" (case-insensitive; "UK" accepted).

Output Schema

NameRequiredDescriptionDefault
inputNo
validYes
reasonNo
countryNo
messageNo
versionYes
zip_nameNo
normalizedYes
country_nameYes
format_exampleYes
has_postal_codesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The description adds substantial context beyond the annotations: the underlying pattern source (Google libaddressinput), an illustrative input/output transformation, and the explicit edge-case behavior for countries without postal codes (valid false, reason "no_postal_codes"). It also reinforces that this is a pure format check with no existence guarantee.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and result shape are front-loaded, followed by the example, the limitation, and the edge case. It is dense and every sentence carries information, though the trailing reference to the equivalent REST endpoint is marginally useful for an MCP caller.

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?

Given annotations covering safety/idempotency, full schema coverage, and an output schema, the remaining unknowns an agent would care about — normalization behavior, failure semantics, and non-postal-code countries — are all addressed. Nothing needed to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds a concrete worked example (NL, "1234ab" → "1234 AB") that shows how the country parameter drives validation and how the code is normalized. This goes slightly beyond the schema's per-field examples.

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 a specific verb and resource (check a postal code's format for a country) and explicitly describes the normalization output and its limits. It is clearly distinct from the only sibling, list_countries, which does not validate anything.

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 clearly scopes when this tool is appropriate — format checking only, not existence or deliverability — which tells an agent when not to rely on it. There is no real alternative tool to route to, so there is no explicit alternative sentence, but the use boundary is well established.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources