Skip to main content
Glama
FreightUtils MCP Server

FreightUtils MCP Server

cbm_calculator

Read-onlyIdempotent

Calculate cubic metres (CBM) from per-piece dimensions and piece count to determine shipment volume for ocean freight pricing.

Instructions

Calculate cubic metres (CBM) for a shipment from per-piece dimensions. CBM is the standard volume unit in international shipping: 1 CBM = 1m x 1m x 1m = 1,000 litres, and ocean freight prices per "freight tonne" (1 CBM or 1,000 kg, whichever is greater).

Behavior: deterministic — identical inputs always return identical figures; total volume = pieces x per-piece CBM (totals are computed from unrounded figures and rounded only for display), with conversions to cubic feet, cubic inches and litres (exact factors: 1 ft = 0.3048 m). Missing or non-positive dimensions error with a validation message naming the parameter. Rate-limited: a limit error carries reset_at, the UTC time the allowance resets.

Returns: cbm_per_piece, total_cbm, cubic_feet, litres, cubic_inches and pieces under result, plus confidence, _source and citation (the FreightUtils v1 response envelope). Field names as this package serves them (snake_case); the hosted /api/mcp endpoint serves the same fields in camelCase (e.g. total_cbm → totalCbm).

Related: chargeable_weight_calculator (air billing weight from the same dims), consignment_calculator (multi-line totals), unit_converter (single conversions), shipment_summary (full composite analysis).

Input Schema

NameRequiredDescriptionDefault
piecesNoNumber of identical pieces — total volume scales linearly. Default: 1.
width_cmYesWidth of one piece in centimetres (> 0). Example: 80.
height_cmYesHeight of one piece in centimetres (> 0). Example: 100.
length_cmYesLength of one piece in centimetres (> 0). Example: 120.

Output Schema

NameRequiredDescriptionDefault
okYes
_metaNo
as_ofNo
resultYes
statusNo
_sourceYes
editionNo
citationYes
validityNo
warningsNo
confidenceYes
missing_inputsNo
blocking_errorsNo
envelope_versionYes
normalized_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.27.0
    • addedOutput schema / properties / _meta / properties / check_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / _meta / properties / edition_basis
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / _meta / properties / receipt
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "created_at": {
      +      "type": "string"
      +    },
      +    "dataset_version": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "engine_version": {
      +      "type": "string"
      +    },
      +    "inputs": {},
      +    "reason": {
      +      "const": "key_required",
      +      "type": "string"
      +    },
      +    "receipt_hash": {
      +      "type": "string"
      +    },
      +    "result": {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "schema_version": {
      +      "type": "string"
      +    },
      +    "stored": {
      +      "const": false,
      +      "type": "boolean"
      +    },
      +    "tool": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "stored",
      +    "reason",
      +    "schema_version",
      +    "receipt_hash",
      +    "created_at",
      +    "tool",
      +    "inputs",
      +    "dataset_version",
      +    "engine_version",
      +    "result"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / _meta / properties / receipt_url
      Added value: +{
      +  "type": "string"
      +}
  2. Changed10 schema fields changedv2.24.0
    • addedOutput schema / properties / _meta
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "identify": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedOutput schema / properties / as_of
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / blocking_errors / items / properties / recovery / properties / params / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / edition
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "applies_from": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "may_apply_until": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "applies_from",
      +        "may_apply_until"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / envelope_version / enum
      Previous value: -[
      -  "1",
      -  "1.1"
      -]New value: +[
      +  "1",
      +  "1.1",
      +  "1.2"
      +]
    • addedOutput schema / properties / missing_inputs
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / normalized_input / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "cbm_per_piece": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "cubic_feet": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "cubic_inches": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "litres": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "meta": {
      -        "anyOf": [
      -          {
      -            "additionalProperties": {},
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "pieces": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "total_cbm": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "total_volume_m3": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": {},
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {},
      +    "properties": {
      +      "cbm_per_piece": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "cubic_feet": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "cubic_inches": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "litres": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "meta": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "pieces": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "total_cbm": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "total_volume_m3": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  }
      +]
    • addedOutput schema / properties / status
      Added value: +{
      +  "enum": [
      +    "ok",
      +    "partial",
      +    "not_found",
      +    "unsupported",
      +    "ambiguous"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / warnings / items / properties / details / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  3. Changed1 schema field changedv2.22.3
    • addedInput schema / properties / pieces / maximum
      Added value: +9007199254740991
  4. 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"
      +]
  5. Changed5 schema fields changedv2.11.0
    • changedInput schema / properties / height_cm / description
      Previous value: -"Height in centimetres"New value: +"Height of one piece in centimetres (> 0). Example: 100."
    • changedInput schema / properties / length_cm / description
      Previous value: -"Length in centimetres"New value: +"Length of one piece in centimetres (> 0). Example: 120."
    • changedInput schema / properties / pieces / description
      Previous value: -"Number of identical pieces (default: 1)"New value: +"Number of identical pieces — total volume scales linearly. Default: 1."
    • changedInput schema / properties / width_cm / description
      Previous value: -"Width in centimetres"New value: +"Width of one piece in centimetres (> 0). Example: 80."
    • 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": {
      +            "cbm_per_piece": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "cubic_feet": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "cubic_inches": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "litres": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "meta": {
      +              "anyOf": [
      +                {
      +                  "additionalProperties": {},
      +                  "type": "object"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "pieces": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "total_cbm": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "total_volume_m3": {
      +              "type": [
      +                "number",
      +                "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"
      +}
  6. First observedv1.0.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, yet the description still adds real behavioral detail: deterministic results, totals computed from unrounded figures and rounded only for display, exact conversion factors, validation errors that name the offending parameter, and rate-limit errors carrying reset_at. It also warns that the hosted /api/mcp endpoint returns camelCase field names, which is a genuine integration gotcha not present in the schema.

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 definition and the freight-tonne rationale, then behavior, returns, and siblings in that order — every paragraph is scannable. Some content is redundant with structured data (enumerating return fields when an output schema exists, the FreightUtils envelope and snake_case/camelCase note), which costs a point.

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?

For a deterministic single-purpose calculator, the definition covers inputs, scaling behavior, error modes, rate limits, and endpoint-variant naming. The return-field listing is redundant given the output schema, but nothing an agent needs to call this correctly is absent.

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 coverage is 100%, so dimensions, units, positivity constraints, examples and the pieces default are all already documented. The description adds only the scaling rule (pieces x per-piece CBM) and conversion factors, which is marginal beyond the schema — baseline 3 is appropriate.

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 first sentence gives a specific verb and resource ("Calculate cubic metres (CBM) for a shipment from per-piece dimensions") and immediately grounds it in the domain (freight tonne pricing). The Related section separates it from chargeable_weight_calculator, consignment_calculator, unit_converter and shipment_summary by naming each sibling's distinct scope.

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?

The Related paragraph routes the agent to alternatives with reasons (air billing weight, multi-line totals, single conversions, composite analysis), which is stronger than most definitions. It stops short of an explicit exclusion statement (e.g. "do not use for multi-line shipments"), leaving that inference to the agent.

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