Skip to main content
Glama
SoapyRED

FreightUtils MCP Server

resolve_reference

Read-onlyIdempotent

Identify any freight identifier from one token, returning ranked, cited candidates with entity types and record links when the format is unknown or ambiguous.

Instructions

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). Thirteen 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, 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), 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesOne freight identifier — e.g. "176", "UN1845", "NLRTM", "FOB", "LHR", "22G1", "MSKU1100810", "090111", "AKE12345AB", "D/E".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
resultYes
_sourceYes
citationYes
validityNo
warningsNo
confidenceYes
blocking_errorsNo
envelope_versionYes
normalized_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.17.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description layers substantial behavior on top: the deterministic normalize-match-rank pipeline, the exact ranking precedence with inspectable rank_basis, zero candidates being a valid non-error result, failed container check digits returning valid:false instead of being dropped, and rate-limit errors carrying reset_at. It also candidly states the limit of what a match asserts. This is well beyond what structured fields convey.

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 and the 'Behavior'/'Limitations'/'Related' labeling makes it scannable. However, the dedicated 'Returns:' paragraph enumerates fields that the output schema already defines, making a ~100-word block functionally redundant, and the example token list is repeated verbatim in the schema. It is informative but over-long for a one-parameter tool.

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-input meta-resolver the description covers everything an agent needs: input constraints, the grammars dispatched, ranking and ambiguity semantics, failure and rate-limit handling, and the explicit scope limits of v1. Return values are also present in the output schema, so nothing material 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 schema already supplies the example tokens, so the baseline is 3. The description adds real value by enumerating the thirteen grammars that consume the parameter and stating the ambiguity contract (colliding grammars return multiple ranked candidates, never a silent guess), but it contributes no syntax or format detail the schema lacks.

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?

Opens with a precise verb+resource+scope: 'Resolve an arbitrary freight identifier — one opaque string in, typed and cited candidates out.' It explicitly positions itself apart from siblings by naming the lookups it resolves into (adr_lookup, airline_lookup, airport_lookup, unlocode_lookup, etc.) and by stating the discriminating condition (use when you do NOT know the identifier's kind).

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 trigger ('when you hold one identifier-ish token ... and do not know what kind of identifier it is'), explicit when-NOT boundaries ('SINGLE-TOKEN resolution, not free-text extraction — pass one identifier, not a manifest line'; SCAC/BIC not covered), and enumerates the alternative lookup tools. The routing decision against siblings is inferable without opening any schema.

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