Skip to main content
Glama

Consignment Calculator

consignment_calculator
Read-onlyIdempotent

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). Selects the chargeable-weight basis.
itemsNoDeprecated flat alias — dimensions in cm, weight in kg. Prefer "lines". Provide lines OR items.
linesNoCanonical consignment lines (preferred). Each: { quantity, dims:{l,w,h,unit}, weight:{value,unit}, optional description / hs_code / un_number / stackable }.
optionsNoOptional: { air_volumetric_divisor, container_number, awb_number }.

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. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / items / items / additionalProperties
      Added value: +false
  2. Changed5 schema fields changed
    • 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. Changed1 schema field changed
    • 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": {},
      +                "propertyNames": {
      +                  "type": "string"
      +                },
      +                "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": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "result": {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "validity": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "as_of": {
      +          "type": "string"
      +        },
      +        "effective_from": {
      +          "type": "string"
      +        },
      +        "effective_to": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "as_of"
      +      ],
      +      "type": "object"
      +    },
      +    "warnings": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "details": {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "envelope_version",
      +    "ok",
      +    "result",
      +    "confidence",
      +    "_source",
      +    "citation"
      +  ],
      +  "type": "object"
      +}
  4. Changed17 schema fields changed
    • changedInput schema / properties / items / description
      Previous value: -"Array of consignment items"New value: +"Deprecated flat alias — dimensions in cm, weight in kg. Prefer \"lines\". Provide lines OR items."
    • changedInput schema / properties / items / items / properties / description / description
      Previous value: -"Item label"New value: +"Item description"
    • changedInput schema / properties / items / items / properties / gross_weight / description
      Previous value: -"Weight per piece in kg"New value: +"Gross weight per piece in kg"
    • addedInput schema / properties / items / items / properties / gross_weight / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / items / items / properties / hs_code
      Added value: +{
      +  "description": "Optional HS commodity code",
      +  "type": "string"
      +}
    • 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: -[
      -  "none",
      -  "euro",
      -  "uk",
      -  "us"
      -]New value: +[
      +  "none",
      +  "euro",
      +  "uk",
      +  "us",
      +  "custom"
      +]
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Number of pieces"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?"
    • addedInput schema / properties / items / items / properties / un_number
      Added value: +{
      +  "description": "Optional UN number for dangerous-goods reference",
      +  "type": "string"
      +}
    • changedInput schema / properties / items / items / required
      Previous value: -[
      -  "length",
      -  "width",
      -  "height",
      -  "quantity",
      -  "gross_weight"
      -]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). Each: { quantity, dims:{l,w,h,unit}, weight:{value,unit}, optional description / hs_code / un_number / stackable }.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "description": {
      +        "description": "Optional item label",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "dims": {
      +        "additionalProperties": false,
      +        "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: mm | cm | m | in",
      +            "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",
      +        "pattern": "^\\d{6,10}$",
      +        "type": "string"
      +      },
      +      "quantity": {
      +        "description": "Number of identical pieces",
      +        "exclusiveMinimum": 0,
      +        "maximum": 100000,
      +        "type": "integer"
      +      },
      +      "stackable": {
      +        "description": "Whether the line may be stacked two-high (halves its loading-metre footprint)",
      +        "type": "boolean"
      +      },
      +      "un_number": {
      +        "description": "Optional UN number for dangerous-goods reference",
      +        "pattern": "^(UN)?\\d{4}$",
      +        "type": "string"
      +      },
      +      "weight": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "unit": {
      +            "description": "Weight unit: kg | g | t | lb",
      +            "enum": [
      +              "kg",
      +              "g",
      +              "t",
      +              "lb"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "Gross weight per piece in the given unit",
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "value",
      +          "unit"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "quantity",
      +      "dims",
      +      "weight"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 50,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Transport mode: sea | air | road (default road). Selects the chargeable-weight basis.",
      +  "enum": [
      +    "sea",
      +    "air",
      +    "road"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / options
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Optional: { air_volumetric_divisor, container_number, awb_number }.",
      +  "properties": {
      +    "air_volumetric_divisor": {
      +      "description": "IATA volumetric divisor in cm³/kg (default 6000). Only affects air.",
      +      "exclusiveMinimum": 0,
      +      "maximum": 10000,
      +      "type": "number"
      +    },
      +    "awb_number": {
      +      "description": "IATA 11-digit air waybill number — check-digit validated, advisory only",
      +      "maxLength": 20,
      +      "type": "string"
      +    },
      +    "container_number": {
      +      "description": "ISO 6346 container number — check-digit validated, advisory only",
      +      "maxLength": 20,
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "items"
      -]
  5. Changed11 schema fields changed
    • removedInput schema / properties / items / items / properties / grossWeightKg
      Removed value: -{
      -  "description": "Weight per piece in kg",
      -  "type": "number"
      -}
    • addedInput schema / properties / items / items / properties / gross_weight
      Added value: +{
      +  "description": "Weight per piece in kg",
      +  "type": "number"
      +}
    • addedInput schema / properties / items / items / properties / height
      Added value: +{
      +  "description": "Height in cm",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • removedInput schema / properties / items / items / properties / heightCm
      Removed value: -{
      -  "description": "Height in cm",
      -  "exclusiveMinimum": 0,
      -  "type": "number"
      -}
    • addedInput schema / properties / items / items / properties / length
      Added value: +{
      +  "description": "Length in cm",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • removedInput schema / properties / items / items / properties / lengthCm
      Removed value: -{
      -  "description": "Length in cm",
      -  "exclusiveMinimum": 0,
      -  "type": "number"
      -}
    • removedInput schema / properties / items / items / properties / palletType
      Removed value: -{
      -  "description": "Pallet type",
      -  "enum": [
      -    "none",
      -    "euro",
      -    "uk",
      -    "us"
      -  ],
      -  "type": "string"
      -}
    • addedInput schema / properties / items / items / properties / pallet_type
      Added value: +{
      +  "description": "Pallet type",
      +  "enum": [
      +    "none",
      +    "euro",
      +    "uk",
      +    "us"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / width
      Added value: +{
      +  "description": "Width in cm",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • removedInput schema / properties / items / items / properties / widthCm
      Removed value: -{
      -  "description": "Width in cm",
      -  "exclusiveMinimum": 0,
      -  "type": "number"
      -}
    • changedInput schema / properties / items / items / required
      Previous value: -[
      -  "lengthCm",
      -  "widthCm",
      -  "heightCm",
      -  "quantity",
      -  "grossWeightKg"
      -]New value: +[
      +  "length",
      +  "width",
      +  "height",
      +  "quantity",
      +  "gross_weight"
      +]
  6. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.