Skip to main content
Glama

Resolve Freight Reference

resolve_reference
Read-onlyIdempotent

Resolve an arbitrary freight identifier — one opaque string in, typed and cited candidates out. Use when you hold one identifier-ish token ("176", "UN1845", "NLRTM", "FOB", "22G1", "MSKU1100810", "D/E") and do not know what kind of identifier it is: each candidate names its entity type and carries the api_url and canonical_url of its full record.

Provide q: ONE identifier (single token, max 32 chars) — or an fu: identifier, the fu_id or fu_version_id of any record in an answer (up to 200 chars), which resolves to exactly its one record or to none. Fourteen grammars all run — UN numbers, AWB prefixes, airline IATA/ICAO, airport IATA/ICAO, UN/LOCODE, ISO 6346 container numbers (check digit computed), HS codes (6-10 digits; national lines resolve at their 6-digit international parent), Incoterms, ADR tunnel codes, ADR Table A codes (special provisions, packing instructions and their PP/B/L provisions, MP, T/BK/TP, tank codes, TU/TC/TE/TA/TT/TM, V/VC/AP/CV/S, vehicle designations, labels, hazard identification numbers — e.g. "TU9" → its meaning, section and review status; a well-formed code no Table A row carries, e.g. "P999", is pattern_only), ULD serials, ISO container size/type codes. Ambiguity is the product: colliding grammars return MULTIPLE ranked candidates ("LHR" is Heathrow AND an Egyptian carrier's ICAO; "336" is an ADR special provision AND a hazard identification number), never a silent guess.

Behavior: deterministic — normalize (trim, uppercase, collapse spaces/dashes, strip a UN prefix), match ALL grammars, rank by record-hit > verification status > static dataset prior (airlines/adr/unlocode first) > stable tiebreak; every candidate carries rank_basis so the ordering is inspectable. Zero candidates is a VALID result (count 0 + note), never an error. A failed container check digit returns a candidate with valid:false rather than dropping it. Rate-limited: a limit error carries reset_at, the UTC time the allowance resets.

Returns: query, normalized, count and candidates[] — each with entity_type, identifier_type, value_normalized, summary, record (the core fields the matching dataset holds), verification_status + verification_basis, rank_basis, canonical_url, api_url and a per-candidate dataset citation — under result, plus confidence, _source and citation (the FreightUtils v1 response envelope).

Limitations: v1 is SINGLE-TOKEN resolution, not free-text extraction — pass one identifier, not a manifest line; SCAC/BIC codes are not yet covered; a match asserts the identifier is known/well-formed, not that a shipment exists.

Related: every lookup tool this resolves into — adr_lookup, airline_lookup, airport_lookup, unlocode_lookup, hs_code_lookup, incoterms_lookup, container_lookup, uld_lookup, validate.

Identifiers: Each record carries fu_id, a stable FreightUtils identifier (and fu_version_id where the dataset has editions); resolve_reference resolves one to exactly its record.

Input Schema

NameRequiredDescriptionDefault
qYesOne freight identifier — e.g. "176", "UN1845", "NLRTM", "FOB", "LHR", "22G1", "MSKU1100810", "090111", "AKE12345AB", "D/E" — or an fu: identifier from any answer's fu_id / fu_version_id (e.g. "fu:adr:un:1203:II:F1@2025"), which resolves to exactly its one record or to none.

Output Schema

NameRequiredDescriptionDefault
okYes
_metaNo
as_ofNo
resultYes
statusNo
_sourceYes
editionNo
citationYes
validityNo
warningsNo
confidenceYes
missing_inputsNo
blocking_errorsNo
envelope_versionYes
normalized_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / _meta / properties / upstream
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "datasets": {
      +      "additionalProperties": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "kind": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "watched",
      +                  "checksum-only",
      +                  "manual"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "last_success": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "reason": {
      +            "type": "string"
      +          },
      +          "stale": {
      +            "type": "boolean"
      +          },
      +          "state": {
      +            "enum": [
      +              "in_step",
      +              "changed_upstream",
      +              "schema_drift",
      +              "unreachable",
      +              "window_missed",
      +              "unknown"
      +            ],
      +            "type": "string"
      +          },
      +          "window_days": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "state",
      +          "kind",
      +          "last_success",
      +          "window_days",
      +          "stale"
      +        ],
      +        "type": "object"
      +      },
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "stale": {
      +      "type": "boolean"
      +    },
      +    "state": {
      +      "enum": [
      +        "in_step",
      +        "changed_upstream",
      +        "schema_drift",
      +        "unreachable",
      +        "window_missed",
      +        "unknown"
      +      ],
      +      "type": "string"
      +    },
      +    "state_read_at": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "state",
      +    "stale",
      +    "state_read_at",
      +    "datasets"
      +  ],
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / q / description
      Previous value: -"One freight identifier — e.g. \"176\", \"UN1845\", \"NLRTM\", \"FOB\", \"LHR\", \"22G1\", \"MSKU1100810\", \"090111\", \"AKE12345AB\", \"D/E\"."New value: +"One freight identifier — e.g. \"176\", \"UN1845\", \"NLRTM\", \"FOB\", \"LHR\", \"22G1\", \"MSKU1100810\", \"090111\", \"AKE12345AB\", \"D/E\" — or an fu: identifier from any answer's fu_id / fu_version_id (e.g. \"fu:adr:un:1203:II:F1@2025\"), which resolves to exactly its one record or to none."
    • changedInput schema / properties / q / maxLength
      Previous value: -32New value: +200
    • addedOutput schema / properties / _meta / properties / ids
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "pattern": {
      +      "type": "string"
      +    },
      +    "scheme": {
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "scheme",
      +    "pattern"
      +  ],
      +  "type": "object"
      +}
  3. Changed2 schema fields changed
    • removedOutput schema / properties / _meta / properties / receipt / properties / reason / const
      Removed value: -"key_required"
    • addedOutput schema / properties / _meta / properties / receipt / properties / reason / enum
      Added value: +[
      +  "key_required",
      +  "quota"
      +]
  4. Changed1 schema field changed
    • addedOutput schema / properties / _meta / properties / receipt
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "created_at": {
      +      "type": "string"
      +    },
      +    "dataset_version": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "engine_version": {
      +      "type": "string"
      +    },
      +    "inputs": {},
      +    "reason": {
      +      "const": "key_required",
      +      "type": "string"
      +    },
      +    "receipt_hash": {
      +      "type": "string"
      +    },
      +    "result": {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "schema_version": {
      +      "type": "string"
      +    },
      +    "stored": {
      +      "const": false,
      +      "type": "boolean"
      +    },
      +    "tool": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "stored",
      +    "reason",
      +    "schema_version",
      +    "receipt_hash",
      +    "created_at",
      +    "tool",
      +    "inputs",
      +    "dataset_version",
      +    "engine_version",
      +    "result"
      +  ],
      +  "type": "object"
      +}
  5. Changed1 schema field changed
    • addedOutput schema / properties / _meta / properties / edition_basis
      Added value: +{
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • addedOutput schema / properties / _meta
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "check_id": {
      +      "type": "string"
      +    },
      +    "receipt_url": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  7. Changed5 schema fields changed
    • addedOutput schema / properties / as_of
      Added value: +{
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / edition
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "applies_from": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "may_apply_until": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "applies_from",
      +        "may_apply_until"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / envelope_version / enum
      Previous value: -[
      -  "1",
      -  "1.1"
      -]New value: +[
      +  "1",
      +  "1.1",
      +  "1.2"
      +]
    • addedOutput schema / properties / missing_inputs
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / status
      Added value: +{
      +  "enum": [
      +    "ok",
      +    "partial",
      +    "not_found",
      +    "unsupported",
      +    "ambiguous"
      +  ],
      +  "type": "string"
      +}
  8. Changed2 schema fields changed
    • removedOutput schema / properties / validity / properties / effective_to / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / validity / properties / effective_to / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  9. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  10. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantial behavior beyond them: deterministic normalization rules, full-grammar matching, the ranking order (record-hit > verification status > dataset prior > stable tiebreak), the fact that zero candidates is a valid result rather than an error, that a failed container check digit returns valid:false instead of dropping the candidate, and that rate-limit errors carry reset_at. This is exactly the extra context annotations cannot convey.

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?

Well front-loaded — purpose, parameter, behavior, returns, limitations, related — and nearly every sentence carries information an agent needs. It is still dense and long for a one-parameter tool, with heavy parenthetical enumerations of ADR Table A subcodes and grammars that could be compressed without losing meaning.

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?

Despite an output schema existing, the description still summarizes the response envelope (query, normalized, count, candidates[] with entity_type, rank_basis, canonical_url, api_url, citation) so the agent knows what it is getting. Combined with explicit limitations (no SCAC/BIC, match does not assert shipment existence) and the fu: identifier note, nothing needed to call this 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 real meaning: it clarifies the single-token 32-character shape for ordinary identifiers versus the up-to-200-character fu: form, and explains that an fu: identifier resolves to exactly one record or none. That goes beyond the schema's example list, though it does not enumerate every grammar's input format.

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 — 'Resolve an arbitrary freight identifier' — and immediately frames the exact contract: 'one opaque string in, typed and cited candidates out.' It distinguishes itself from the sibling lookup tools by positioning itself as the disambiguation entry point that feeds adr_lookup, airline_lookup, airport_lookup, and the rest.

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?

Gives an explicit when-to-use condition: 'Use when you hold one identifier-ish token ... and do not know what kind of identifier it is,' with concrete examples. It also states when-not-to-use ('v1 is SINGLE-TOKEN resolution, not free-text extraction — pass one identifier, not a manifest line') and names the downstream tools it resolves into.

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.