Logistics & Postal Intelligence · Deterministic Engine Slug: unlocode_port_resolver 0-LLM Deterministic

UN/LOCODE Global Port & Trade Hub Resolver

Ocean bills of lading, customs declarations, and freight forwarder APIs rely on 5-character UN/LOCODE identifiers where a single transposed letter stalls customs clearance.

5-Second Try-Now Console Connect via /mcp FastMesh SuperBus

How It Works & Live Probe Telemetry

Backed by an embedded deterministic dataset of major global seaports, rail hubs, and air cargo gateways, this tool executes in 0.1 ms with zero upstream dependencies. Supplying a 5-character locode (^[A-Za-z]{2}[A-Za-z0-9]{3}$) such as USLAX resolves 'Los Angeles' along with its verified modal functions (Seaport, Rail terminal, Road terminal, Airport). Alternatively, omit locode and pass a city substring query to search matching hubs.

Verified Endpoint & Billing Contract

MCP Tool Nameunlocode_port_resolver
Subdomain & Modelogistics_address · deterministic
REST EndpointPOST https://devour-com.fastmesh.dev/v1/organs/unlocode_port_resolver/invoke
MCP EndpointPOST https://devour-com.fastmesh.dev/mcp (also mounted on https://mcp.fastmesh.dev/mcp)
Verified Probe Latency0.1 ms (HTTP 200, verified 2026-12-02T10:50:00Z)
Archive Cache TTL30 days (2592000s) cross-tenant verified-hit cache
Empty / Error RuleCharge $0.00 when code fails 5-character UN/LOCODE format or no matching port/city entry is found.
Plans & PrivacyStarter $19/mo · Pro $79/mo · Scale $249/mo · Zero trajectory resale

Production Use Cases

ScenarioTrigger InputDeterministic Output Value
Bill of Lading Pre-ValidationVerify origin CNSHA and destination USLAX before EDI transmissionConfirms valid 5-char UN/LOCODE and seaport function flag
Multimodal Freight RoutingCheck whether hub supports rail or road handoffInspects functions array for Rail terminal and Airport capability
City-to-Port MatchingAgent has city name 'Rotterdam' but lacks port codeReturns NLRTM via deterministic substring search

MCP JSON-RPC 2.0 & REST Invocation Examples

Call via MCP tools/call on https://devour-com.fastmesh.dev/mcp:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "unlocode_port_resolver",
    "arguments": {
      "locode": "USLAX"
    }
  }
}

Or invoke directly via REST (POST /v1/organs/unlocode_port_resolver/invoke):

curl -sS -X POST https://devour-com.fastmesh.dev/v1/organs/unlocode_port_resolver/invoke \
  -H 'Content-Type: application/json' \
  -d '{"input": {"locode": "USLAX"}}'

Verified structured JSON response:

{
  "ok": true,
  "matches": [
    {
      "locode": "USLAX",
      "name": "Los Angeles",
      "country": "US",
      "functions": [
        "Seaport",
        "Rail terminal",
        "Road terminal",
        "Airport"
      ]
    }
  ],
  "format_valid": true,
  "billable_usd": "0.005"
}

Strict Input Schema

{
  "type": "object",
  "properties": {
    "locode": {
      "type": "string",
      "pattern": "^[A-Za-z]{2}[A-Za-z0-9]{3}$",
      "description": "5-character UN/LOCODE (e.g. CNSHA, USLAX, NLRTM, DEHAM, SGSIN)."
    },
    "query": {
      "type": "string",
      "description": "Optional city/port substring search when locode is omitted."
    }
  },
  "additionalProperties": false
}

Frequently Asked Questions

Does UN/LOCODE lookup depend on an external UNECE web scrape?

No. All lookups run deterministically in-process against curated trade hub tables, guaranteeing 0.1 ms latency and 100% uptime.

When does the tool return $0 billing?

Whenever the code fails the 5-character pattern or matches zero port/city entries in the dataset.

Related Commerce & Marketing MCP Tools