Skip to main content
Glama

ShippingRates MCP Server

Calculate Demurrage & Detention Costs

shippingrates_dd_calculate
Read-onlyIdempotent

Calculate demurrage and detention (D&D) costs for one carrier in one country.

Use this when the user needs a detailed cost breakdown for a specific carrier. Returns free days, per-diem rates for each tariff slab, and total cost. This is the core tool for logistics cost analysis — it answers "how much will I pay if my container is detained X days?"

To compare D&D costs across all carriers at once, use shippingrates_dd_compare instead.

By default this returns carrier detention/demurrage. Pass charge_type="storage" to instead get TERMINAL port storage — a distinct charge billed by the terminal, not the carrier, and never mixed into the default D&D answer. Storage coverage is thin — only a handful of carrier/country lanes have it. Any uncovered combo returns an explicit 'no data' error (never a false $0), and that error names the lanes that ARE covered, derived live from the database rather than from a hardcoded list that would go stale.

PAID: $0.10/call via x402 (USDC on Base or Solana). Without payment, returns 402 with payment instructions.

Returns: { line, country, container_type, days, free_days, breakdown, total_cost, currency, charge_type_served, charge_family: 'carrier_dd'|'terminal_storage' }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysYesNumber of detention days
lineYesShipping line slug — maersk, msc, cmacgm (or cma-cgm), hapag-lloyd, one, cosco, zim, evergreen, yangming, hmm, arkas, oocl, pil
countryYesISO 2-letter country code (e.g. IN, AE, SG)
directionNoimport or export (default import)
x_paymentNox402 payment proof header (optional — required for paid access)
charge_typeNoOverride the charge type; default is the engine's detention→demurrage→combined priority. 'storage' is a distinct TERMINAL charge (not carrier D&D) and is ONLY ever returned when explicitly requested here — thin coverage, see tool description.
container_typeYesISO 6346 container type — 20GP, 40GP, 40HC, 20RF, 40RF, 20OT, 40OT, 45HC, 40FR, 20FR, 40DG, 20DG, 45RF, 45OT, 45DG, 40TK, 20TK, 45GP, 45TK, 40NOR

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedInput schema / properties / line / enum
      Previous value: -[
      -  "maersk",
      -  "msc",
      -  "cmacgm",
      -  "cma-cgm",
      -  "hapag-lloyd",
      -  "one",
      -  "cosco",
      -  "zim",
      -  "evergreen",
      -  "yangming",
      -  "hmm",
      -  "arkas",
      -  "oocl",
      -  "pil"
      -]New value: +[
      +  "maersk",
      +  "msc",
      +  "cmacgm",
      +  "cma-cgm",
      +  "hapag-lloyd",
      +  "one",
      +  "cosco",
      +  "zim",
      +  "evergreen",
      +  "yangming",
      +  "hmm",
      +  "arkas",
      +  "oocl",
      +  "pil",
      +  "wanhai"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / charge_type
      Added value: +{
      +  "description": "Override the charge type; default is the engine's detention→demurrage→combined priority. 'storage' is a distinct TERMINAL charge (not carrier D&D) and is ONLY ever returned when explicitly requested here — thin coverage, see tool description.",
      +  "enum": [
      +    "detention",
      +    "demurrage",
      +    "combined",
      +    "storage"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / direction
      Added value: +{
      +  "description": "import or export (default import)",
      +  "enum": [
      +    "import",
      +    "export"
      +  ],
      +  "type": "string"
      +}
  3. Changed4 schema fields changed
    • changedInput schema / properties / container_type / description
      Previous value: -"ISO 6346 container type — 20DV, 40DV, 40HC, 20RF, 40RF, 20OT, 40OT, 20FR, 40FR"New value: +"ISO 6346 container type — 20GP, 40GP, 40HC, 20RF, 40RF, 20OT, 40OT, 45HC, 40FR, 20FR, 40DG, 20DG, 45RF, 45OT, 45DG, 40TK, 20TK, 45GP, 45TK, 40NOR"
    • changedInput schema / properties / container_type / enum
      Previous value: -[
      -  "20DV",
      -  "40DV",
      -  "40HC",
      -  "20RF",
      -  "40RF",
      -  "20OT",
      -  "40OT",
      -  "20FR",
      -  "40FR"
      -]New value: +[
      +  "20GP",
      +  "40GP",
      +  "40HC",
      +  "20RF",
      +  "40RF",
      +  "20OT",
      +  "40OT",
      +  "45HC",
      +  "40FR",
      +  "20FR",
      +  "40DG",
      +  "20DG",
      +  "45RF",
      +  "45OT",
      +  "45DG",
      +  "40TK",
      +  "20TK",
      +  "45GP",
      +  "45TK",
      +  "40NOR"
      +]
    • changedInput schema / properties / line / description
      Previous value: -"Shipping line slug — one of: maersk, msc, cma-cgm, hapag-lloyd, one, cosco"New value: +"Shipping line slug — maersk, msc, cmacgm (or cma-cgm), hapag-lloyd, one, cosco, zim, evergreen, yangming, hmm, arkas, oocl, pil"
    • changedInput schema / properties / line / enum
      Previous value: -[
      -  "maersk",
      -  "msc",
      -  "cma-cgm",
      -  "hapag-lloyd",
      -  "one",
      -  "cosco"
      -]New value: +[
      +  "maersk",
      +  "msc",
      +  "cmacgm",
      +  "cma-cgm",
      +  "hapag-lloyd",
      +  "one",
      +  "cosco",
      +  "zim",
      +  "evergreen",
      +  "yangming",
      +  "hmm",
      +  "arkas",
      +  "oocl",
      +  "pil"
      +]
  4. Changed2 schema fields changed
    • changedInput schema / properties / container_type / description
      Previous value: -"Container type code"New value: +"ISO 6346 container type — 20DV, 40DV, 40HC, 20RF, 40RF, 20OT, 40OT, 20FR, 40FR"
    • changedInput schema / properties / line / description
      Previous value: -"Shipping line slug"New value: +"Shipping line slug — one of: maersk, msc, cma-cgm, hapag-lloyd, one, cosco"
  5. First observed

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; the description adds meaningful behavior: storage is never mixed into default D&D, thin coverage yields an explicit 'no data' error (never false $0), and without payment returns 402. It also explains default charge type priority and payment mechanism, all beyond the annotation fields.

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?

Description is organized into clear paragraphs: purpose, usage context, storage caveat, payment, and return summary. While longer than average, each section adds essential guidance, and there is no filler or repetition.

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?

The description covers return fields (free_days, breakdown, total_cost, etc.), payment requirement, error handling, storage coverage, and the alternative comparison tool. With this level of detail and no output schema, the description fully equips an agent to select and invoke the tool correctly.

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 covers 100% of parameters with descriptions, so baseline is 3. The description adds value by explaining charge_type='storage' as a terminal charge distinct from carrier D&D and the default priority order (detention→demurrage→combined). It also clarifies x_payment as a payment header, but the schema already lists this; the added context on storage semantics justifies a 4.

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?

The opening sentence clearly states 'Calculate demurrage and detention (D&D) costs for one carrier in one country' — a specific verb, resource, and scope. It explicitly contrasts with shippingrates_dd_compare for cross-carrier comparison, distinguishing it from a sibling tool.

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?

Provides explicit when-to-use guidance: 'Use this when the user needs a detailed cost breakdown for a specific carrier.' Names the alternative: 'To compare D&D costs across all carriers at once, use shippingrates_dd_compare instead.' Also clarifies storage as a special case.

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.

TDQS

A4.3/5.0
Disambiguation4/5

Most tools have clearly distinct purposes: D&D calculator/compare/countdown, inland search/haulage/compare, and congestion/news/risk are well separated. However, the transit/vessel group (transit, transit_schedules, vessel_schedule, vessel_schedule_options) and rates vs total_cost could cause some selection ambiguity, though descriptions help differentiate them.

Naming Consistency3/5

All tools share the 'shippingrates_' prefix and snake_case, but naming patterns vary: some are action-oriented (shippingrates_dd_calculate, shippingrates_inland_compare), while others are noun phrases (shippingrates_surcharges, shippingrates_port, shippingrates_total_cost). This inconsistency could make it harder to predict tool names.

Tool Count3/5

With 26 tools, the server is on the heavier side, exceeding the typical 15-tool comfort zone. However, the broad domain of shipping rates, logistics, and regulatory data justifies the number, as each tool covers a distinct aspect. Still, the volume may overwhelm agents.

Completeness5/5

The tool set is remarkably comprehensive for a shipping rates server, covering freight benchmarks, surcharges, local charges, D&D (calculate/compare/countdown), inland haulage, transit schedules, vessel schedules, congestion, risk scoring, regulatory updates, facilities, FX, and a composite total-cost calculator. No obvious gaps for common logistics cost-analysis workflows.