Skip to main content
Glama

Classify a postal address

classify_address
Read-onlyIdempotent

Classify a postal address as structured, hybrid, or unstructured under SWIFT's structured-address rule. Get classification flags to see if it meets CBPR+ standards.

Instructions

Classify a postal address as structured, hybrid, or unstructured.

Use this to see where an address stands against the SWIFT structured-address
rule: ``structured`` (town + country + structured detail, no free-form
lines), ``hybrid`` (town + country + 1-2 free-form ``adr_line`` lines, the
minimum CBPR+ UG2026 bar), or ``unstructured`` (free-form only — rejected
from the cliff date). To check acceptability under a policy use
``validate_address``; to upgrade legacy lines use ``repair_address``.

Returns ``{"classification": str, "is_structured": bool, "is_hybrid":
bool, "is_unstructured": bool, "has_structured_fields": bool}`` or an
``{"error": ...}`` payload.

Args:
    address: The postal address as a dict of snake_case fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesAn ISO 20022 PostalAddress27 as a dict of snake_case fields, e.g. {'strt_nm': 'High St', 'bldg_nb': '1', 'pst_cd': 'AB1 2CD', 'twn_nm': 'London', 'ctry': 'GB'} and optional 'adr_line' (list of free-form lines). 'ctry' must be ISO 3166-1 alpha-2.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.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 non-destructive behavior, so the description does not need to restate safety. It adds useful behavioral context beyond annotations by specifying the exact return payload structure and the error payload, plus the policy significance of the unstructured category. There is no contradiction with annotations.

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 core purpose is front-loaded, followed by usage guidance and return contract. The text is slightly longer than strictly necessary because the 'Args' line largely duplicates the schema, but every substantive sentence earns its place by defining categories, giving policy context, or naming sibling tools.

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?

For a single-parameter, read-only classification tool with no output schema, the description is complete: it defines the classification categories, explains when to use it, names alternatives, and documents both success and error return shapes. An agent has everything needed to invoke it correctly.

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?

Schema description coverage is 100% and the schema already documents the `address` parameter with an example, field semantics, and the ISO 3166-1 alpha-2 requirement. The description's 'Args' line merely restates 'dict of snake_case fields' and adds little 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?

The description opens with a specific verb and resource: 'Classify a postal address as structured, hybrid, or unstructured.' It defines the three output categories and links them to the SWIFT structured-address rule, so an agent can immediately understand what the tool does and how it differs from nearby validation/repair tools.

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?

The description states when to use the tool ('Use this to see where an address stands against the SWIFT structured-address rule') and explicitly names alternatives for other intents: 'To check acceptability under a policy use validate_address; to upgrade legacy lines use repair_address.' This is direct routing guidance with no ambiguity.

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