Skip to main content
Glama
SoapyRED

FreightUtils MCP Server

consignment_calculator

Read-onlyIdempotent

Calculate per-line and grand totals for multi-item shipments: CBM, LDM, volumetric weight, and mode-specific chargeable figures for sea, air, or road, plus advisory flags.

Instructions

Calculate per-line and grand totals for a multi-item mixed consignment: CBM, loading metres (LDM), volumetric weight, and the mode-specific chargeable figure (air chargeable weight, sea revenue tonnes, road LDM), plus objective advisory flags.

Provide mode (sea | air | road, default road) and either lines[] (canonical — per line: quantity, dims {l,w,h,unit}, weight {value,unit}, optional description / hs_code / un_number / stackable) or the legacy flat items[] (dimensions in cm, weight in kg). Air uses an IATA volumetric divisor (default 6000, settable via options.air_volumetric_divisor); options.container_number / options.awb_number add a check-digit sanity flag.

Behavior: deterministic; flags are advisory only — implausible density, mode/option mismatch, dangerous-goods presence by UN number against ADR 2025, and container/AWB check-digit validity — and never state that a shipment is permitted or compliant. Invalid lines error naming the offending field. Canonical schema: https://www.freightutils.com/schema/consignment.v1.json. Rate-limited: a limit error carries reset_at, the UTC time the allowance resets.

Returns: schema_version, mode, per_line[] (cbm, gross_weight_kg, density, volumetric_weight_kg, ldm, revenue_tonnes, chargeable_weight_kg), totals (incl. billing_basis) and flags[] under result, plus confidence, _source and citation (the FreightUtils v1 response envelope).

Limitations: best-effort deterministic calculation and reference data — not regulatory, customs or dangerous-goods compliance advice; classification, documentation and carrier acceptance remain your responsibility.

Related: cbm_calculator / chargeable_weight_calculator / ldm_calculator (single-figure versions), shipment_summary (adds vehicle/container suggestion and duty estimates), adr_lookup (what a flagged UN number is).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoTransport mode: sea | air | road. Default: road.
itemsNoLegacy flat alias — dimensions in cm, weight in kg. Prefer lines.
linesNoCanonical consignment lines (preferred, 1-50). Provide lines OR items.
optionsNoOptional settings.

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. Changed7 schema fields changedv2.22.3
    • addedInput schema / properties / lines / items / properties / description / maxLength
      Added value: +200
    • addedInput schema / properties / lines / items / properties / hs_code / pattern
      Added value: +"^\\d{6,10}$"
    • addedInput schema / properties / lines / items / properties / quantity / maximum
      Added value: +100000
    • addedInput schema / properties / lines / items / properties / un_number / pattern
      Added value: +"^(UN)?\\d{4}$"
    • addedInput schema / properties / options / properties / air_volumetric_divisor / maximum
      Added value: +10000
    • addedInput schema / properties / options / properties / awb_number / maxLength
      Added value: +20
    • addedInput schema / properties / options / properties / container_number / maxLength
      Added value: +20
  2. Changed5 schema fields changedv2.17.2
    • addedOutput schema / properties / _source / properties / authority_current_edition
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / _source / properties / checked_at
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / _source / properties / dataset_edition
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / envelope_version / const
      Removed value: -"1"
    • addedOutput schema / properties / envelope_version / enum
      Added value: +[
      +  "1",
      +  "1.1"
      +]
  3. Changed28 schema fields changedv2.11.0
    • changedInput schema / properties / items / description
      Previous value: -"Deprecated flat alias — dimensions in cm, weight in kg. Prefer lines."New value: +"Legacy flat alias — dimensions in cm, weight in kg. Prefer lines."
    • changedInput schema / properties / items / items / properties / description / description
      Previous value: -"Item description"New value: +"Item description."
    • changedInput schema / properties / items / items / properties / gross_weight / description
      Previous value: -"Gross weight per piece in kg"New value: +"Gross weight per piece in kg."
    • changedInput schema / properties / items / items / properties / height / description
      Previous value: -"Height in cm"New value: +"Height in cm."
    • changedInput schema / properties / items / items / properties / length / description
      Previous value: -"Length in cm"New value: +"Length in cm."
    • changedInput schema / properties / items / items / properties / pallet_type / description
      Previous value: -"Pallet type (informational)"New value: +"Pallet type (informational)."
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Number of pieces (default 1)"New value: +"Number of pieces. Default: 1."
    • changedInput schema / properties / items / items / properties / width / description
      Previous value: -"Width in cm"New value: +"Width in cm."
    • changedInput schema / properties / lines / description
      Previous value: -"Canonical consignment lines (preferred). Provide lines OR items."New value: +"Canonical consignment lines (preferred, 1-50). Provide lines OR items."
    • changedInput schema / properties / lines / items / properties / description / description
      Previous value: -"Optional item label"New value: +"Optional item label."
    • changedInput schema / properties / lines / items / properties / dims / description
      Previous value: -"Dimensions with unit"New value: +"Per-piece dimensions with unit."
    • changedInput schema / properties / lines / items / properties / dims / properties / h / description
      Previous value: -"Height in the given unit"New value: +"Height in the given unit."
    • changedInput schema / properties / lines / items / properties / dims / properties / l / description
      Previous value: -"Length in the given unit"New value: +"Length in the given unit."
    • changedInput schema / properties / lines / items / properties / dims / properties / unit / description
      Previous value: -"Dimension unit"New value: +"Dimension unit."
    • changedInput schema / properties / lines / items / properties / dims / properties / w / description
      Previous value: -"Width in the given unit"New value: +"Width in the given unit."
    • changedInput schema / properties / lines / items / properties / hs_code / description
      Previous value: -"Optional HS commodity code (6–10 digits)"New value: +"Optional HS commodity code (6-10 digits)."
    • changedInput schema / properties / lines / items / properties / quantity / description
      Previous value: -"Number of identical pieces"New value: +"Number of identical pieces on this line."
    • changedInput schema / properties / lines / items / properties / stackable / description
      Previous value: -"Stack two-high (halves loading-metre footprint)"New value: +"Stack two-high (halves the loading-metre footprint)."
    • changedInput schema / properties / lines / items / properties / un_number / description
      Previous value: -"Optional UN number for dangerous-goods reference"New value: +"Optional UN number — triggers the dangerous-goods advisory flag."
    • changedInput schema / properties / lines / items / properties / weight / description
      Previous value: -"Weight with unit"New value: +"Per-piece weight with unit."
    • changedInput schema / properties / lines / items / properties / weight / properties / unit / description
      Previous value: -"Weight unit"New value: +"Weight unit."
    • changedInput schema / properties / lines / items / properties / weight / properties / value / description
      Previous value: -"Gross weight per piece"New value: +"Gross weight per piece."
    • changedInput schema / properties / mode / description
      Previous value: -"Transport mode: sea | air | road (default road)"New value: +"Transport mode: sea | air | road. Default: road."
    • changedInput schema / properties / options / description
      Previous value: -"Optional settings"New value: +"Optional settings."
    • changedInput schema / properties / options / properties / air_volumetric_divisor / description
      Previous value: -"IATA volumetric divisor in cm³/kg (default 6000). Air only."New value: +"IATA volumetric divisor in cm³/kg. Default: 6000. Air mode only."
    • changedInput schema / properties / options / properties / awb_number / description
      Previous value: -"IATA 11-digit air waybill number, check-digit validated"New value: +"IATA 11-digit air waybill number — check-digit validated into flags."
    • changedInput schema / properties / options / properties / container_number / description
      Previous value: -"ISO 6346 container number, check-digit validated"New value: +"ISO 6346 container number — check-digit validated into flags."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "_source": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "checked": {
      +          "type": "string"
      +        },
      +        "name": {
      +          "type": "string"
      +        },
      +        "provenance_status": {
      +          "enum": [
      +            "verified",
      +            "pending-verification",
      +            "computed",
      +            "live"
      +          ],
      +          "type": "string"
      +        },
      +        "source_url": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "checked",
      +        "provenance_status"
      +      ],
      +      "type": "object"
      +    },
      +    "blocking_errors": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "recovery": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "action": {
      +                "type": "string"
      +              },
      +              "params": {
      +                "additionalProperties": {},
      +                "type": "object"
      +              },
      +              "tool": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "action"
      +            ],
      +            "type": "object"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message",
      +          "recovery"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "citation": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "qualifier": {
      +          "type": "string"
      +        },
      +        "text": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "text"
      +      ],
      +      "type": "object"
      +    },
      +    "confidence": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "basis": {
      +          "enum": [
      +            "deterministic",
      +            "provenance",
      +            "match_quality",
      +            "freshness"
      +          ],
      +          "type": "string"
      +        },
      +        "level": {
      +          "enum": [
      +            "high",
      +            "medium",
      +            "low"
      +          ],
      +          "type": "string"
      +        },
      +        "score": {
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "level",
      +        "basis"
      +      ],
      +      "type": "object"
      +    },
      +    "envelope_version": {
      +      "const": "1",
      +      "type": "string"
      +    },
      +    "normalized_input": {
      +      "additionalProperties": {},
      +      "type": "object"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "result": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": true,
      +          "properties": {
      +            "air_volumetric_divisor": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "disclaimer": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "flags": {
      +              "anyOf": [
      +                {
      +                  "items": {},
      +                  "type": "array"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "mode": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "per_line": {
      +              "anyOf": [
      +                {
      +                  "items": {
      +                    "additionalProperties": true,
      +                    "properties": {
      +                      "cbm": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "chargeable_weight_kg": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "density_kg_per_m3": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "description": {
      +                        "type": [
      +                          "string",
      +                          "null"
      +                        ]
      +                      },
      +                      "gross_weight_kg": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "ldm": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "quantity": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "revenue_tonnes": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      },
      +                      "volumetric_weight_kg": {
      +                        "type": [
      +                          "number",
      +                          "null"
      +                        ]
      +                      }
      +                    },
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "schema_version": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "totals": {
      +              "anyOf": [
      +                {
      +                  "additionalProperties": {},
      +                  "type": "object"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "additionalProperties": {},
      +          "type": "object"
      +        }
      +      ]
      +    },
      +    "validity": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "as_of": {
      +          "type": "string"
      +        },
      +        "effective_from": {
      +          "type": "string"
      +        },
      +        "effective_to": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "as_of"
      +      ],
      +      "type": "object"
      +    },
      +    "warnings": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "details": {
      +            "additionalProperties": {},
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "envelope_version",
      +    "ok",
      +    "result",
      +    "confidence",
      +    "_source",
      +    "citation"
      +  ],
      +  "type": "object"
      +}
  4. Changed15 schema fields changedv2.4.1
    • changedInput schema / properties / items / description
      Previous value: -"Array of consignment items"New value: +"Deprecated flat alias — dimensions in cm, weight in kg. Prefer lines."
    • changedInput schema / properties / items / items / properties / gross_weight / description
      Previous value: -"Gross weight per item in kg"New value: +"Gross weight per piece in kg"
    • addedInput schema / properties / items / items / properties / gross_weight / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / items / items / properties / pallet_type / description
      Previous value: -"Pallet type"New value: +"Pallet type (informational)"
    • changedInput schema / properties / items / items / properties / pallet_type / enum
      Previous value: -[
      -  "euro",
      -  "uk",
      -  "us",
      -  "custom",
      -  "none"
      -]New value: +[
      +  "none",
      +  "euro",
      +  "uk",
      +  "us",
      +  "custom"
      +]
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Number of items (default: 1)"New value: +"Number of pieces (default 1)"
    • changedInput schema / properties / items / items / properties / stackable / description
      Previous value: -"Can items be stacked?"New value: +"Can the item be stacked?"
    • changedInput schema / properties / items / items / required
      Previous value: -[
      -  "length",
      -  "width",
      -  "height"
      -]New value: +[
      +  "length",
      +  "width",
      +  "height",
      +  "gross_weight"
      +]
    • addedInput schema / properties / items / maxItems
      Added value: +50
    • addedInput schema / properties / items / minItems
      Added value: +1
    • addedInput schema / properties / lines
      Added value: +{
      +  "description": "Canonical consignment lines (preferred). Provide lines OR items.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "description": {
      +        "description": "Optional item label",
      +        "type": "string"
      +      },
      +      "dims": {
      +        "additionalProperties": false,
      +        "description": "Dimensions with unit",
      +        "properties": {
      +          "h": {
      +            "description": "Height in the given unit",
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          "l": {
      +            "description": "Length in the given unit",
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          "unit": {
      +            "description": "Dimension unit",
      +            "enum": [
      +              "mm",
      +              "cm",
      +              "m",
      +              "in"
      +            ],
      +            "type": "string"
      +          },
      +          "w": {
      +            "description": "Width in the given unit",
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "l",
      +          "w",
      +          "h",
      +          "unit"
      +        ],
      +        "type": "object"
      +      },
      +      "hs_code": {
      +        "description": "Optional HS commodity code (6–10 digits)",
      +        "type": "string"
      +      },
      +      "quantity": {
      +        "description": "Number of identical pieces",
      +        "exclusiveMinimum": 0,
      +        "type": "integer"
      +      },
      +      "stackable": {
      +        "description": "Stack two-high (halves loading-metre footprint)",
      +        "type": "boolean"
      +      },
      +      "un_number": {
      +        "description": "Optional UN number for dangerous-goods reference",
      +        "type": "string"
      +      },
      +      "weight": {
      +        "additionalProperties": false,
      +        "description": "Weight with unit",
      +        "properties": {
      +          "unit": {
      +            "description": "Weight unit",
      +            "enum": [
      +              "kg",
      +              "g",
      +              "t",
      +              "lb"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "Gross weight per piece",
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "value",
      +          "unit"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "quantity",
      +      "dims",
      +      "weight"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 50,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / properties / mode / description
      Previous value: -"Transport mode (default: road)"New value: +"Transport mode: sea | air | road (default road)"
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "road",
      -  "air",
      -  "sea"
      -]New value: +[
      +  "sea",
      +  "air",
      +  "road"
      +]
    • addedInput schema / properties / options
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Optional settings",
      +  "properties": {
      +    "air_volumetric_divisor": {
      +      "description": "IATA volumetric divisor in cm³/kg (default 6000). Air only.",
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    },
      +    "awb_number": {
      +      "description": "IATA 11-digit air waybill number, check-digit validated",
      +      "type": "string"
      +    },
      +    "container_number": {
      +      "description": "ISO 6346 container number, check-digit validated",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "items"
      -]
  5. Addedv2.1.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial non-schema context: deterministic behavior, advisory-only flags that never assert compliance or permission, invalid lines erroring with the offending field name, and a rate limit whose error carries reset_at. This is exactly the extra behavioral layer the annotations don't cover.

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?

Dense but well-organized and front-loaded: purpose first, then inputs, behavior, returns, limitations, related tools. The Returns paragraph partly duplicates the output schema, which is mild waste, but the rest earns its place.

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 nested schema, full schema coverage, annotations, and an output schema, the description covers everything an agent still needs: alternative parameter forms, defaults, error semantics, rate-limit behavior, and the advisory/non-compliance boundary.

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 coverage is 100% so the baseline is 3, but the description adds genuine meaning beyond the schema: it marks lines[] as canonical vs. legacy items[], states the air divisor default of 6000 and that container_number/awb_number drive a check-digit flag. This helps an agent choose the right parameter shape rather than merely restating the schema.

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 verb (calculate) and the precise outputs (CBM, LDM, volumetric weight, mode-specific chargeable figure) for multi-item mixed consignments. It explicitly distinguishes itself from the single-figure siblings (cbm_calculator, chargeable_weight_calculator, ldm_calculator) and shipment_summary.

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?

Gives clear input guidance (provide mode plus lines[] or legacy items[]) and names the related tools with the differentiated conditions in parentheses, e.g. shipment_summary 'adds vehicle/container suggestion and duty estimates'. It stops short of an explicit 'use X instead when Y' rule, but the routing is unambiguous.

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