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 in USDC per successful call, paid with x402 (Base, Solana or Arc); 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.4/5.0
Behavior5/5

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

Beyond the read-only annotation, the description discloses important behavior: calendar-day counting with the start day included by default, no carrier-tariff lookup, and a per-successful-call x402 price with failed calls uncharged. This is exactly the kind of behavioral context an agent needs before invoking a paid calculator.

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?

The description is front-loaded with purpose and packs the essential calculation rules, outputs, lookup limitation, and pricing into a compact form. The first sentence is dense and repeats some schema detail, but there is little wasted wording.

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?

Given a 7-parameter calculator with full schema coverage and an output schema, the description covers the calculation model, counting convention, tariff limitation, and payment model. Nothing critical for correct invocation appears to be 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 description coverage is 100%, so the input schema already documents every parameter in detail. The description reinforces the rate syntax and start-day counting rule, but it adds little parameter meaning beyond what the schema already provides.

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 description states a specific calculator for container demurrage or detention and names the exact inputs and outputs: start/end dates, free days, tiered rates, chargeable days, tier split, and totals. It clearly distinguishes the two calculation modes by tying start/end semantics to discharge, gate-out, and empty return.

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?

It gives clear context for when the tool applies and specifies that carrier tariffs are not looked up, so the agent knows rates must be supplied. It does not explicitly name an alternative sibling tool or when not to use this calculator, but the operational context is clear.

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