Skip to main content
Glama

Container demurrage or detention calculator: from the start

logistics_demurrage_detention
Read-only

Container demurrage or detention calculator: from the start date (discharge or gate-out), end date (gate-out or empty return), free days and the carrier's tiered daily rates you supply (e.g. 1-4:75,5-8:150,9+:250), returns chargeable days, the day-by-day tier split and the total per container and for all containers. Counts calendar days, start day included unless you say otherwise. Carrier tariffs are not looked up. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

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": {
      "start": "<start>",
      "end": "<end>",
      "freeDays": "<freeDays>",
      "rates": "<rates>"
    },
    "name": "logistics_demurrage_detention"
  }
}

Input Schema

NameRequiredDescriptionDefault
endYesEnd date YYYY-MM-DD: gate-out full (demurrage) or empty return (detention) (required)
ratesYesTiers after free time, 'from-to:rate' comma separated, last open-ended with '+', e.g. 1-4:75,5-8:150,9+:250 (required)
startYesStart date YYYY-MM-DD: discharge (demurrage) or gate-out full (detention) (required)
currencyNoCurrency label for the output, default USD
freeDaysYesFree days granted, 0-60 (required)
containersNoNumber of containers, default 1
countStartDayNotrue (default) counts the start date as day 1; false starts on the next day

Output Schema

NameRequiredDescriptionDefault
tiersNo
totalNo
currencyNo
daysUsedNo
freeDaysNo
containersNo
freeTimeEndsNo
perContainerNo
chargeableDaysNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description goes well beyond by disclosing the x402/USDC payment model, the $0.002 per-successful-call price, that failed calls are free, and the day-counting convention ('start day included unless you say otherwise'). These are operational facts an agent cannot obtain from the schema or annotations.

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?

Front-loaded with the core purpose and outputs, and the pricing/limitation caveats are placed at the end where they belong. It is a single dense paragraph and the rate-format example is somewhat redundant with the schema, which keeps it from a 5.

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?

Covers inputs, day-counting semantics, the tariff-lookup limitation, and payment terms for a 7-parameter tool, which is solid. Because an output schema already exists, the space spent enumerating return values (tier split, per-container and total) is somewhat redundant rather than essential.

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 description coverage is 100%, so the baseline is 3. The description restates the rate tier syntax ('1-4:75,5-8:150,9+:250') and the start-day counting rule, but both are already documented in the schema, so it adds little new meaning beyond what structured fields provide.

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 resource and calculation ('Container demurrage or detention calculator') plus the exact inputs (start/end dates, free days, tiered rates) and the outputs (chargeable days, tier split, totals). It is instantly distinguishable from sibling tools like logistics_customs_duty_calc or tariff lookup services.

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

Usage Guidelines4/5

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

Clearly frames the tool as a calculator that consumes user-supplied carrier rates, and explicitly excludes an alternative behavior with 'Carrier tariffs are not looked up' – which routes an agent needing actual tariff data elsewhere. It stops short of naming a specific sibling alternative or giving explicit when-not-to-use conditions, so it sits just below a 5.

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