Skip to main content
Glama

Decode a barcode

decode
Read-onlyIdempotent

Read a package barcode or tracking number (IMpb), or a letter's or flat's Intelligent Mail barcode (IMb) from its digits or bars: its layout, each field's digits and meaning, whether the check digit or the bars' frame check holds, and the service type code's or Service Type ID's row in the USPS list, each with the passage that says so. A field's meaning is postalref's words: quote a cite's lit, USPS's, with its passage.

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": {
      "barcode": "<barcode>"
    },
    "name": "decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
barcodeYesThe digits under a package barcode, or all 30 or 34 with 420 and the ZIP Code. Or a letter's or flat's Intelligent Mail barcode: its 20, 25, 29 or 31 digits, or its 65 bars as A, D, F and T from the left. Spaces and dashes are fine.

Output Schema

NameRequiredDescriptionDefault
specYes
checksYes
digitsYes
fieldsYes
formatYes
verdictYes
trackingYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / fields / items / properties / code / properties / rows / items / properties / notes
      Added value: +{
      +  "items": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "mark": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "page": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "pdf": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "printed": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "pdf"
      +        ],
      +        "type": "object"
      +      },
      +      "revision": {
      +        "type": "string"
      +      },
      +      "text": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "mark",
      +      "text",
      +      "revision",
      +      "page"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / barcode / description
      Previous value: -"The digits under a package barcode, or all 30 or 34 with 420 and the ZIP Code. Spaces and dashes are fine."New value: +"The digits under a package barcode, or all 30 or 34 with 420 and the ZIP Code. Or a letter's or flat's Intelligent Mail barcode: its 20, 25, 29 or 31 digits, or its 65 bars as A, D, F and T from the left. Spaces and dashes are fine."
    • changedInput schema / properties / barcode / maxLength
      Previous value: -80New value: +160
  3. Changed1 schema field changed
    • addedInput schema / properties / barcode / description
      Added value: +"The digits under a package barcode, or all 30 or 34 with 420 and the ZIP Code. Spaces and dashes are fine."
  4. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description still adds real behavioral content beyond them: it discloses that the tool validates the check digit and the bars' frame check and returns a service-type row plus supporting passages, which tells the agent what to expect from a call. The closing sentence about `meaning` and citing `lit` is jargon-heavy and less transparent than the rest.

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?

The purpose is front-loaded in the opening clause, but the first sentence is a long run-on chain of four 'its...' clauses, and the trailing sentence ('A field's `meaning` is postalref's words: quote a cite's `lit`...') is compressed internal shorthand that costs more parsing effort than it returns.

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?

With an output schema present and one fully documented parameter, most burden is already carried, and the description is rich enough for an agent to call correctly. It is slightly over-explained on return values it need not restate and silent on failure behavior for malformed input, but nothing essential 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?

Schema coverage is 100% and the single `barcode` parameter already documents accepted formats, length bounds, and that spaces and dashes are tolerated. The description restates the same resource taxonomy without adding format rules the schema lacks, so the baseline 3 applies.

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?

The description names a specific verb-plus-resource pair: reading a package barcode (IMpb) or an Intelligent Mail barcode (IMb) from its digits or bars, and it enumerates the decoded output (layout, per-field digits/meaning, check-digit or frame-check status, service type row). It stops short of explicitly contrasting itself with the `lookup` or `define` siblings, so an agent must infer the split from the input type alone.

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

Usage Guidelines3/5

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

Usage is only implied: the input-shape discussion (package digits vs. 20/25/29/31 letter digits vs. 65 A/D/F/T bars) tells an agent what belongs here rather than when to pick this over `lookup`, `define`, or `search`. There is no explicit when-not-to-use clause or named alternative.

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