Skip to main content
Glama

Sootcase freight emissions calculator

Calculate a shipment's emissions

calculate_shipment
Read-onlyIdempotent

Calculates one shipment's greenhouse gas emissions (kg CO2e: well-to-wheel, tank-to-wheel, well-to-tank) following the GLEC Framework v3.3 and ISO 14083. Routes each leg's distance from its coordinates or codes. Returns the result per leg (distance and how it was found, method, data type, emission factor and its source, distance adjustment, notes on legs Sootcase added) and a step-by-step calculation sheet with the arithmetic and the GLEC page and ISO 14083 clause behind each step.

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": {
      "legs": "<legs>"
    },
    "name": "calculate_shipment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoYour reference for the shipment
teuNoContainers in TEU, instead of weight_kg; with teu_net_tonnes, or alone for GLEC's average of 10 t per TEU
hubsNoHub stops: hub_type transshipment, storage_transshipment, warehouse or liquid_bulk_terminal, per tonne (add _mixed, except to warehouse, for sites with ambient and temperature-controlled goods); intermodal_terminal or intermodal_terminal_temperature_controlled, per container (give containers). GLEC v3.3 Table 3.
legsYesThe legs in order, from where the shipper hands the goods over to where the consignee receives them.
weight_kgNoCargo weight in kg (or give teu instead)
cargo_typeNoOptional, GLEC v3.3 cargo or load category: container, temperature_controlled, light, heavy, or for European rail cars, chemicals, coal_steel, building_materials, manufactured_products, cereals, truck_trailer_on_train, trailer_on_train. Picks GLEC's value for it where GLEC has one for the leg's vehicle; otherwise the vehicle's own value (the leg's note says which).
add_road_legsNoAdd road legs where the legs don't join up (gaps over 5 km), and to a port or terminal when a sea, rail or river leg starts or ends off its network (default true). Added legs are marked in the result.
container_loadNoWith teu, instead of teu_net_tonnes: average (10 t), light (6 t) or heavy (14.5 t) per TEU, from the GLEC Framework
teu_net_tonnesNoWith teu: net cargo tonnes per TEU (container tare is not added)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / legs / items / properties / vehicle_type / description
      Previous value: -"A short alias or a full id from list_vehicle_types. Common: road hgv (average truck), hgv_artic_33t (articulated truck over 33 t, a 40 t semitrailer), hgv_rigid, van; rail freight_train; sea container_ship (short-sea factor under 2,000 km, deep-sea from 2,000 km), bulk_carrier, general_cargo, roro, ropax; air air_freight; inland_waterway barge, container_barge."New value: +"A short alias or a full id from list_vehicle_types. Common: road hgv (average truck), hgv_artic_33t (articulated truck over 33 t, a 40 t semitrailer), hgv_rigid, van; rail freight_train; sea container_ship (GLEC's container value for the ports' trade lane), bulk_carrier, general_cargo, roro, ropax; air air_freight; inland_waterway barge, container_barge."
  2. Changed1 schema field changed
    • changedInput schema / properties / hubs / description
      Previous value: -"Hub stops: hub_type transshipment, storage_transshipment, warehouse or liquid_bulk_terminal (add _mixed for ambient and temperature-controlled sites), per tonne; intermodal_terminal or intermodal_terminal_temperature_controlled, per container (give containers). GLEC v3.3 Table 3."New value: +"Hub stops: hub_type transshipment, storage_transshipment, warehouse or liquid_bulk_terminal, per tonne (add _mixed, except to warehouse, for sites with ambient and temperature-controlled goods); intermodal_terminal or intermodal_terminal_temperature_controlled, per container (give containers). GLEC v3.3 Table 3."
  3. Changed1 schema field changed
    • addedInput schema / properties / legs / items / properties / vehicle
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Road legs: the truck, so the route keeps to roads it may use (hgv bans, height, width, length and weight limits, and tunnels barred to its dangerous goods, from OpenStreetMap). Routing is built for one profile: 4.0 m, 2.60 m, 18.75 m, 40 t, 11.5 t per axle; a bigger truck is refused. Only with figures the user gave.",
      +  "properties": {
      +    "axle_load_kg": {
      +      "description": "Heaviest axle load",
      +      "maximum": 15000,
      +      "minimum": 1000,
      +      "type": "number"
      +    },
      +    "axles": {
      +      "maximum": 12,
      +      "minimum": 2,
      +      "type": "integer"
      +    },
      +    "gross_weight_kg": {
      +      "description": "Truck, trailer and cargo",
      +      "maximum": 60000,
      +      "minimum": 3500,
      +      "type": "number"
      +    },
      +    "hazmat": {
      +      "description": "Carries dangerous goods (ADR)",
      +      "type": "boolean"
      +    },
      +    "height_m": {
      +      "description": "Height with load",
      +      "maximum": 5,
      +      "minimum": 1.5,
      +      "type": "number"
      +    },
      +    "length_m": {
      +      "description": "Length of the whole combination",
      +      "maximum": 30,
      +      "minimum": 4,
      +      "type": "number"
      +    },
      +    "trailer": {
      +      "enum": [
      +        "none",
      +        "semi",
      +        "drawbar"
      +      ],
      +      "type": "string"
      +    },
      +    "tunnel_code": {
      +      "description": "The load's ADR tunnel restriction code",
      +      "enum": [
      +        "B",
      +        "C",
      +        "D",
      +        "E"
      +      ],
      +      "type": "string"
      +    },
      +    "width_m": {
      +      "description": "Width without mirrors",
      +      "maximum": 3.5,
      +      "minimum": 1.5,
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / legs / items / properties / cargo_type
      Added value: +{
      +  "description": "Optional: this leg's GLEC cargo category, instead of the shipment's (same values as the shipment's cargo_type)",
      +  "type": "string"
      +}
  5. Changed4 schema fields changed
    • changedInput schema / properties / legs / items / properties / fuel / properties / factor / properties / ttw_kg_per_unit / description
      Previous value: -"Tank-to-wheel kg CO2e per unit (part of WTW)"New value: +"Tank-to-wheel kg CO2e per unit (part of WTW; 0 only for electricity). Required: ask the user if missing"
    • changedInput schema / properties / legs / items / properties / fuel / properties / factor / required
      Previous value: -[
      -  "unit",
      -  "wtw_kg_per_unit",
      -  "source"
      -]New value: +[
      +  "unit",
      +  "wtw_kg_per_unit",
      +  "ttw_kg_per_unit",
      +  "source"
      +]
    • changedInput schema / properties / legs / items / properties / own_factor / properties / ttw_g_per_tkm / description
      Previous value: -"Tank-to-wheel g CO2e per tonne-km (part of WTW)"New value: +"Tank-to-wheel g CO2e per tonne-km (part of WTW; 0 only when no fuel is burnt in the vehicle, e.g. electric). Required: ask the user if missing"
    • changedInput schema / properties / legs / items / properties / own_factor / required
      Previous value: -[
      -  "wtw_g_per_tkm",
      -  "source"
      -]New value: +[
      +  "wtw_g_per_tkm",
      +  "ttw_g_per_tkm",
      +  "source"
      +]
  6. Changed3 schema fields changed
    • addedInput schema / properties / legs / items / properties / fuel / properties / factor
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "The fuel supplier's own emission factor, instead of the dataset's (fuel is then just its name).",
      +  "properties": {
      +    "biogenic_co2_kg_per_unit": {
      +      "description": "Biogenic CO2 per unit, reported apart (optional)",
      +      "type": "number"
      +    },
      +    "source": {
      +      "description": "Who gives the factor, and for what",
      +      "type": "string"
      +    },
      +    "ttw_kg_per_unit": {
      +      "description": "Tank-to-wheel kg CO2e per unit (part of WTW)",
      +      "type": "number"
      +    },
      +    "unit": {
      +      "description": "Unit of amount, e.g. l, kg, kWh",
      +      "type": "string"
      +    },
      +    "wtw_kg_per_unit": {
      +      "description": "Well-to-wheel kg CO2e per unit",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "unit",
      +    "wtw_kg_per_unit",
      +    "source"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / legs / items / properties / own_factor
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "The carrier's or the user's own intensity for this leg (primary data), instead of a default value. Only with a figure the user gave; never estimate one.",
      +  "properties": {
      +    "distance_basis": {
      +      "description": "Distance type the intensity is per tonne-km of; leave out if it matches the leg's",
      +      "enum": [
      +        "sfd",
      +        "gcd",
      +        "actual"
      +      ],
      +      "type": "string"
      +    },
      +    "source": {
      +      "description": "Who measured it, and for what (e.g. the carrier's report and year)",
      +      "type": "string"
      +    },
      +    "ttw_g_per_tkm": {
      +      "description": "Tank-to-wheel g CO2e per tonne-km (part of WTW)",
      +      "type": "number"
      +    },
      +    "wtw_g_per_tkm": {
      +      "description": "Well-to-wheel g CO2e per tonne-km",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "wtw_g_per_tkm",
      +    "source"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / legs / items / required
      Previous value: -[
      -  "mode",
      -  "vehicle_type"
      -]New value: +[
      +  "mode"
      +]
  7. Changed1 schema field changed
    • addedInput schema / properties / cargo_type
      Added value: +{
      +  "description": "Optional, GLEC v3.3 cargo or load category: container, temperature_controlled, light, heavy, or for European rail cars, chemicals, coal_steel, building_materials, manufactured_products, cereals, truck_trailer_on_train, trailer_on_train. Picks GLEC's value for it where GLEC has one for the leg's vehicle; otherwise the vehicle's own value (the leg's note says which).",
      +  "type": "string"
      +}
  8. Changed2 schema fields changed
    • changedInput schema / properties / hubs / description
      Previous value: -"Hub stops: hub_type transshipment, storage_transshipment, warehouse or liquid_bulk_terminal (add _mixed for ambient and temperature-controlled sites); GLEC v3.3 Table 3 values per tonne."New value: +"Hub stops: hub_type transshipment, storage_transshipment, warehouse or liquid_bulk_terminal (add _mixed for ambient and temperature-controlled sites), per tonne; intermodal_terminal or intermodal_terminal_temperature_controlled, per container (give containers). GLEC v3.3 Table 3."
    • addedInput schema / properties / hubs / items / properties / containers
      Added value: +{
      +  "description": "Containers handled, for intermodal terminals",
      +  "type": "number"
      +}
  9. Changed1 schema field changed
    • changedInput schema / properties / hubs / description
      Previous value: -"Hub stops (transhipment, storage); needs a dataset with hub factors."New value: +"Hub stops: hub_type transshipment, storage_transshipment, warehouse or liquid_bulk_terminal (add _mixed for ambient and temperature-controlled sites); GLEC v3.3 Table 3 values per tonne."
  10. Changed1 schema field changed
    • addedInput schema / properties / legs / items / properties / repositioning_km
      Added value: +{
      +  "description": "Trucks: km driven empty for this trip (to the pickup or back), shared over the truck's load like empty running. Without a load, the shipment is taken as the whole load.",
      +  "type": "number"
      +}
  11. Changed2 schema fields changed
    • changedInput schema / properties / container_load / description
      Previous value: -"With teu: a container load profile defined by the dataset, instead of teu_net_tonnes"New value: +"With teu, instead of teu_net_tonnes: average (10 t), light (6 t) or heavy (14.5 t) per TEU, from the GLEC Framework"
    • changedInput schema / properties / teu / description
      Previous value: -"Containers in TEU, instead of weight_kg; needs teu_net_tonnes"New value: +"Containers in TEU, instead of weight_kg; with teu_net_tonnes, or alone for GLEC's average of 10 t per TEU"
  12. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With readOnlyHint/idempotentHint already declaring the safety profile, the description adds real behavioral context: it enumerates what comes back per leg (distance and how it was found, method, data type, emission factor and source, adjustment, notes on legs the tool added) and describes the step-by-step calculation sheet with GLEC page and ISO clause citations. That is substantive disclosure, especially since no output schema exists. It stops short of covering failure modes (unknown codes, unroutable legs) or limits on leg count.

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?

Two sentences, front-loaded with purpose and standards, then output structure; nothing is padded or repetitive. The second sentence is heavy with nested parentheses and long enumerations that slow reading, but every clause carries information.

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?

For a complex nine-parameter calculator with no output schema, the description does the important work of explaining the return payload and the methodological basis. What is missing is scope guidance relative to the batch/scenario siblings and any statement about behavior when routing or factor lookup fails.

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 parameter meaning is already carried by the schema, and the description's contribution is limited to reinforcing that distances are routed from coordinates or codes. It does not add selection logic across the nine top-level parameters (e.g. teu versus weight_kg, load_tonnes versus load_factor), which remains schema-level. Baseline 3 applies.

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?

"Calculates one shipment's greenhouse gas emissions" gives a specific verb and resource, and immediately names the three reported quantities (WTW, TTW, WTT in kg CO2e) plus the standards followed (GLEC v3.3, ISO 14083). The word "one" implicitly separates it from the batch sibling calculate_shipments, and the scope of the output is stated up front.

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

Usage Guidelines3/5

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

Usage context is implied rather than stated: it is clearly the single-shipment calculator, but the description never says when to use this versus calculate_shipments, compare_scenario or emissions_report. The only routing-style guidance ("Use find_places to look up coordinates") lives inside the schema, not the tool description.

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