Skip to main content
Glama

calculate_freight

Freight & logistics emissions (Scope 3 Cat 4 & 9), GLEC framework. THE FACTOR'S DENOMINATOR PICKS THE METHOD — check the factor's unit before choosing the input. Per tonne-km: emissions = tonnes × km × factor, send "mass". Per TEU-km (the sea-container family, e.g. freight_detailed.sea.container.trans_suez.dry): emissions = TEU × km × factor, send "teu" — a TEU is a twenty-foot container slot, not a mass, and a forty-foot box is 2 TEU. Sending mass against a per-TEU-km factor is refused (422), not converted. Find mode factors via search_factors (section "freight" or "freight_detailed"), e.g. freight.road_hgv.tonne_km.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teuNo{ "value": <number> } — container slots. Required for a per-TEU-km factor; omit for a per-tonne-km one.
massNo{ "value": <number>, "unit": "tonne|kg|lb" }. Required for a per-tonne-km factor; omit for a per-TEU-km one.
distanceYes{ "value": <number>, "unit": "km|mi|nmi" }.
factor_keyYesFreight factor key. Its unit says whether to send mass (per tonne-km) or teu (per TEU-km).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / factor_key / description
      Previous value: -"Per-tonne-km freight factor key."New value: +"Freight factor key. Its unit says whether to send mass (per tonne-km) or teu (per TEU-km)."
    • changedInput schema / properties / mass / description
      Previous value: -"{ \"value\": <number>, \"unit\": \"tonne|kg|lb\" }."New value: +"{ \"value\": <number>, \"unit\": \"tonne|kg|lb\" }. Required for a per-tonne-km factor; omit for a per-TEU-km one."
    • addedInput schema / properties / teu
      Added value: +{
      +  "description": "{ \"value\": <number> } — container slots. Required for a per-TEU-km factor; omit for a per-tonne-km one.",
      +  "type": "object"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "mass",
      -  "distance",
      -  "factor_key"
      -]New value: +[
      +  "distance",
      +  "factor_key"
      +]
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden. It discloses that the factor's denominator dictates the input method, defines TEU as a container slot (not mass), explains the forty-foot conversion, and states the exact error behavior (422 rather than conversion). This goes well beyond a generic 'calculate' statement.

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 somewhat long but every sentence is functional: it states the domain, the core rule, the two methods with examples, the error condition, and the search path. The key rule is emphasized with caps and the structure is logical. It's not verbose, but slightly dense.

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?

Given the complexity (two unit systems, error handling, conditional parameters, factor discovery) and the absence of an output schema, the description covers the major pitfalls. It mentions error 422, the search_factors path, and example factor keys. It doesn't describe the return format, but that's arguably not required without an output schema. It's fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Even though schema coverage is 100%, the description adds meaning beyond the schema: it explains the conditional requirement (mass required for per-tonne-km, teu for per-TEU-km), the relationship between factor unit and input selection, and unit conversions (forty-foot = 2 TEU). This is significant value added over the schema's bare parameter descriptions.

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 opens with a specific resource and scope: 'Freight & logistics emissions (Scope 3 Cat 4 & 9), GLEC framework.' The verb 'calculate' and the explicit domain distinguish it from sibling tools like calculate_business_travel or calculate_electricity, making the tool's purpose unambiguous.

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

Usage Guidelines5/5

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

It explicitly instructs when to send 'mass' versus 'teu' based on the factor's unit, and warns that a mismatch is refused with a 422 error. It also directs to search_factors for finding the right factor key, covering both the 'how' and the 'when' conditions.

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