Skip to main content
Glama

Search codes and terms

search
Read-onlyIdempotent

Search the codes, terms, banner texts, specs and documents postalref models, by one index: names and codes whose key is the query's first, then those that start with it, then those with words that start with its words, then codes whose row has its words. A term hit carries its kind (mail-class, extra-service, service, program, system, file, identifier, document, facility, container, role or term) and its tier (core, or reference: only in Publication 32, the glossary of July 2013, with that date). A query of 20 or more digits, or an Intelligent Mail barcode's 65 bars as A, D, F and T, comes back as one to decode. A hit's path goes to read: a term's entries, a code's row and history. A code also goes to lookup with its table.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoAt most this many hits; 10 when absent.
queryYesA code, a term or words from a code's row: 055, mailer id, ground advantage.

Output Schema

NameRequiredDescriptionDefault
hitsYes
queryYes
totalYes
decodeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / hits / items / properties / path
      Added value: +{
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / hits / items / properties / entity / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "_tag": {
      -        "enum": [
      -          "Term"
      -        ],
      -        "type": "string"
      -      },
      -      "slug": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "_tag",
      -      "slug"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "_tag": {
      -        "enum": [
      -          "Document"
      -        ],
      -        "type": "string"
      -      },
      -      "slug": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "_tag",
      -      "slug"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "_tag": {
      -        "enum": [
      -          "Table"
      -        ],
      -        "type": "string"
      -      },
      -      "slug": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "_tag",
      -      "slug"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "_tag": {
      -        "enum": [
      -          "Spec"
      -        ],
      -        "type": "string"
      -      },
      -      "slug": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "_tag",
      -      "slug"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "_tag": {
      -        "enum": [
      -          "Field"
      -        ],
      -        "type": "string"
      -      },
      -      "key": {
      -        "type": "string"
      -      },
      -      "spec": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "_tag",
      -      "spec",
      -      "key"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "_tag": {
      -        "enum": [
      -          "Code"
      -        ],
      -        "type": "string"
      -      },
      -      "code": {
      -        "type": "string"
      -      },
      -      "table": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "_tag",
      -      "table",
      -      "code"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "_tag": {
      +        "enum": [
      +          "Term"
      +        ],
      +        "type": "string"
      +      },
      +      "dated": {
      +        "type": "string"
      +      },
      +      "is": {
      +        "items": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "_tag": {
      +                  "enum": [
      +                    "Product"
      +                  ],
      +                  "type": "string"
      +                },
      +                "node": {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "_tag",
      +                "node"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "_tag": {
      +                  "enum": [
      +                    "Document"
      +                  ],
      +                  "type": "string"
      +                },
      +                "node": {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "_tag",
      +                "node"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "_tag": {
      +                  "enum": [
      +                    "Spec"
      +                  ],
      +                  "type": "string"
      +                },
      +                "spec": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "_tag",
      +                "spec"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "_tag": {
      +                  "enum": [
      +                    "Field"
      +                  ],
      +                  "type": "string"
      +                },
      +                "key": {
      +                  "type": "string"
      +                },
      +                "spec": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "_tag",
      +                "spec",
      +                "key"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "_tag": {
      +                  "enum": [
      +                    "Table"
      +                  ],
      +                  "type": "string"
      +                },
      +                "table": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "_tag",
      +                "table"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "_tag": {
      +                  "enum": [
      +                    "Code"
      +                  ],
      +                  "type": "string"
      +                },
      +                "code": {
      +                  "type": "string"
      +                },
      +                "table": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "_tag",
      +                "table",
      +                "code"
      +              ],
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        "type": "array"
      +      },
      +      "kind": {
      +        "enum": [
      +          "mail-class",
      +          "extra-service",
      +          "service",
      +          "program",
      +          "system",
      +          "file",
      +          "identifier",
      +          "document",
      +          "facility",
      +          "container",
      +          "role",
      +          "term"
      +        ],
      +        "type": "string"
      +      },
      +      "slug": {
      +        "type": "string"
      +      },
      +      "tier": {
      +        "enum": [
      +          "core",
      +          "reference"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "_tag",
      +      "slug",
      +      "kind",
      +      "tier"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "_tag": {
      +        "enum": [
      +          "Code"
      +        ],
      +        "type": "string"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "table": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "_tag",
      +      "table",
      +      "code"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "_tag": {
      +        "enum": [
      +          "Value"
      +        ],
      +        "type": "string"
      +      },
      +      "column": {
      +        "type": "string"
      +      },
      +      "table": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "_tag",
      +      "table",
      +      "column",
      +      "value"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, closed-world and non-destructive, so safety is not the burden here. The description adds real behavior: the ranked match order (exact key, prefix, word-prefix, then codes whose row contains the words), the term `kind` enumeration, and the `tier` distinction where 'reference' entries exist only in Publication 32 (July 2013). It does not discuss result-count limits or empty-result behavior, which the schema partially covers.

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

Conciseness3/5

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

It is a single dense paragraph with the verb and resource front-loaded, and most clauses carry information. However, the ranking sentence ('names and codes whose key is the query's first, then those that start with it...') is convoluted, and the opening clause 'Search the codes, terms, banner texts, specs and documents postalref models' is garbled enough to slow comprehension.

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?

Because an output schema exists, return values need not be spelled out, yet the description still characterizes a hit's fields (`kind`, `tier`, `path`) and the special single-result decode case. Combined with the routing to `read` and `lookup`, an agent has enough to invoke and follow up correctly. Only the `limit` behavior is left entirely to the schema.

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 coverage is 100%, so the schema already documents both `query` and `limit`, establishing the baseline of 3. The description adds some meaning beyond it — that a query may be a bare code, a term, or words drawn from a code's row, and that very long numeric/barcode inputs are interpreted specially — but it never mentions `limit` or its default of 10.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (search) and enumerates the resources searched (codes, terms, banner texts, specs, documents in postalref models), which an agent could not infer from the name alone. It also distinguishes itself from siblings by noting that a hit's `path` leads to `read` and a code also leads to `lookup`. The phrasing 'postalref models' is opaque and the sentence is grammatically tangled, keeping it short of a 5.

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?

Gives concrete routing: use this to find an entry, then follow `path` to `read` for a term's entries or a code's row/history, and use `lookup` when you have a code plus its table. It also flags a special input class (20+ digits or a 65-bar IMb) that returns a decode result rather than hits. It does not say when to prefer `grep` or `diff` instead, so no explicit exclusions.

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