Skip to main content
Glama

Calculate GHG inventory

calculate_inventory
Read-onlyIdempotent

Calculate an auditable GHG inventory from explicit activity records. Returns per-line gas/CO2e results, Scope 1/2/3 and category rollups, dual Scope 2 reporting, indeterminate lines, factor lineage, notary payload, and an offset-clearinghouse dry-run weave. This is calculation, not advice. Price: $1.00 per call after 10 free calls/day. Pay at /x402/ghg-ledger/calculate_inventory with Base USDC, cash-fund payment_ref through escrow_checkout + confirm_escrow_funding, or use /seats. Each activity needs activity_type, quantity, unit, region and year (the year the activity took place; the latest bundled factor dated on or before it is used and recorded on the line). list_factor_packs names the bundled activity types and regions. One activity object is accepted as a list of one. If a call returns indeterminate, the response includes first_call_help. Example arguments: {"activities": [{"id": "office-electricity", "activity_type": "purchased_electricity", "quantity": "12000", "unit": "kWh", "region": "US", "year": 2023}, {"id": "backup-generator", "activity_type": "stationary_combustion_diesel", "quantity": "400", "unit": "gallons", "region": "US", "year": 2025}], "options": {}}

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calculate_inventory"
  }
}

Input Schema

NameRequiredDescriptionDefault
optionsNoOptional. Settings, for example factor_year_policy or offset_buyer.
activitiesNoThe activities to inventory: a list of {activity_type, quantity, unit, region, year}. One object or a JSON string is also accepted.
request_idNoOptional. Your id for this call. Repeat it to retry safely: the same request_id is never charged twice.
payment_refNoOptional. A paid credit or payment reference, used only after the free daily calls. Leave it out to use the free tier or a seat.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed2 schema fields changed
    • changedInput schema / $defs / Activity / properties / activity_type / description
      Previous value: -"What the activity is. One of: business_travel_air, business_travel_bus, business_travel_passenger_car, business_travel_rail, mobile_combustion_diesel, mobile_combustion_gasoline, purchased_electricity, purchased_goods_spend, refrigerant_hfc_134a, refrigerant_hfc_32, stationary_combustion_diesel, stationary_combustion_natural_gas, stationary_combustion_propane, waste_landfilled_mixed_msw."New value: +"What the activity is. One of: business_travel_air, business_travel_bus, business_travel_passenger_car, business_travel_rail, mobile_combustion_diesel, mobile_combustion_gasoline, purchased_electricity, purchased_goods_spend, refrigerant_hfc_134a, refrigerant_hfc_32, stationary_combustion_diesel, stationary_combustion_natural_gas, stationary_combustion_propane, waste_landfilled_mixed_msw. Plain words such as electricity or power are read as purchased_electricity, and the line says so."
    • changedInput schema / $defs / Activity / properties / region / description
      Previous value: -"Where it happened. One of: GLOBAL, UK, US, US-AKGD, US-AKMS, US-AZNM, US-CAMX, US-ERCT, US-FRCC, US-HIMS, US-HIOA, US-MROE, US-MROW, US-NEWE, US-NWPP, US-NYCW, US-NYLI, US-NYUP, US-PRMS, US-RFCE, US-RFCM, US-RFCW, US-RMPA, US-SPNO, US-SPSO, US-SRMV, US-SRMW, US-SRSO, US-SRTV, US-SRVC. The US-XXXX codes are EPA eGRID grid subregions, for electricity only (US-CAMX California, US-ERCT Texas, US-NYUP upstate New York, US-RFCE Mid-Atlantic, and so on); use US for fuels and when the subregion is unknown; GLOBAL is for refrigerants."New value: +"Where it happened. One of: GLOBAL, UK, US, US-AKGD, US-AKMS, US-AZNM, US-CAMX, US-ERCT, US-FRCC, US-HIMS, US-HIOA, US-MROE, US-MROW, US-NEWE, US-NWPP, US-NYCW, US-NYLI, US-NYUP, US-PRMS, US-RFCE, US-RFCM, US-RFCW, US-RMPA, US-SPNO, US-SPSO, US-SRMV, US-SRMW, US-SRSO, US-SRTV, US-SRVC. The US-XXXX codes are EPA eGRID grid subregions, for electricity only (US-CAMX California, US-ERCT Texas, US-NYUP upstate New York, US-RFCE Mid-Atlantic, and so on); use US for fuels and when the subregion is unknown; GLOBAL is for refrigerants. For electricity, a US state name or code (Vermont, VT) is read as its eGRID subregion only when the state sits in one subregion; a split state such as Texas comes back indeterminate with the subregions to choose from."
  3. Changed4 schema fields changed
    • changedInput schema / $defs / Activity / properties / activity_type / description
      Previous value: -"What the activity is. One of: business_travel_passenger_car, mobile_combustion_diesel, mobile_combustion_gasoline, purchased_electricity, purchased_goods_spend, refrigerant_hfc_134a, refrigerant_hfc_32, stationary_combustion_diesel, stationary_combustion_natural_gas, stationary_combustion_propane, waste_landfilled_mixed_msw."New value: +"What the activity is. One of: business_travel_air, business_travel_bus, business_travel_passenger_car, business_travel_rail, mobile_combustion_diesel, mobile_combustion_gasoline, purchased_electricity, purchased_goods_spend, refrigerant_hfc_134a, refrigerant_hfc_32, stationary_combustion_diesel, stationary_combustion_natural_gas, stationary_combustion_propane, waste_landfilled_mixed_msw."
    • addedInput schema / $defs / Activity / properties / flight_haul
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Only for business_travel_air: short (under 300 miles per flight), medium (300 to 2300 miles) or long (2300 miles and over). Send one line per haul.",
      +  "title": "Flight Haul"
      +}
    • changedInput schema / $defs / Activity / properties / mobile_source_class / description
      Previous value: -"Only for mobile fuels: nonroad_four_stroke for mobile_combustion_gasoline, nonroad for mobile_combustion_diesel."New value: +"Only for mobile fuels. on_road for trucks, vans and cars (either fuel); nonroad_four_stroke for non-road gasoline equipment; nonroad for non-road diesel equipment."
    • changedInput schema / $defs / Activity / properties / unit / description
      Previous value: -"Unit of `quantity`. Electricity: kWh or MWh. Natural gas: therm, mmbtu or kWh. Liquid fuels: gallon_us or litre. Refrigerants: kg or lb. Landfilled waste: short_ton or metric_tonne. Car travel: mile or km. Purchased goods by spend: usd."New value: +"Unit of `quantity`. Electricity: kWh or MWh. Natural gas: therm, mmbtu or kWh. Liquid fuels: gallon_us or litre. Refrigerants: kg or lb. Landfilled waste: short_ton or metric_tonne. Car travel: mile or km. Air, rail and bus travel: passenger_mile or km (passenger-km). Purchased goods by spend: usd."
  4. Changed4 schema fields changed
    • addedInput schema / properties / activities / description
      Added value: +"The activities to inventory: a list of {activity_type, quantity, unit, region, year}. One object or a JSON string is also accepted."
    • addedInput schema / properties / options / description
      Added value: +"Optional. Settings, for example factor_year_policy or offset_buyer."
    • addedInput schema / properties / payment_ref / description
      Added value: +"Optional. A paid credit or payment reference, used only after the free daily calls. Leave it out to use the free tier or a seat."
    • addedInput schema / properties / request_id / description
      Added value: +"Optional. Your id for this call. Repeat it to retry safely: the same request_id is never charged twice."
  5. Changed1 schema field changed
    • changedInput schema / $defs / Activity / properties / region / description
      Previous value: -"Where it happened. One of: GLOBAL, UK, US, US-CAMX, US-ERCT. US-CAMX is the California grid and US-ERCT the Texas grid (electricity only); use US elsewhere in the United States; GLOBAL is for refrigerants."New value: +"Where it happened. One of: GLOBAL, UK, US, US-AKGD, US-AKMS, US-AZNM, US-CAMX, US-ERCT, US-FRCC, US-HIMS, US-HIOA, US-MROE, US-MROW, US-NEWE, US-NWPP, US-NYCW, US-NYLI, US-NYUP, US-PRMS, US-RFCE, US-RFCM, US-RFCW, US-RMPA, US-SPNO, US-SPSO, US-SRMV, US-SRMW, US-SRSO, US-SRTV, US-SRVC. The US-XXXX codes are EPA eGRID grid subregions, for electricity only (US-CAMX California, US-ERCT Texas, US-NYUP upstate New York, US-RFCE Mid-Atlantic, and so on); use US for fuels and when the subregion is unknown; GLOBAL is for refrigerants."
  6. Changed2 schema fields changed
    • addedInput schema / $defs
      Added value: +{
      +  "Activity": {
      +    "additionalProperties": true,
      +    "description": "One measured activity: what happened, how much, where and when.",
      +    "properties": {
      +      "activity_type": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "What the activity is. One of: business_travel_passenger_car, mobile_combustion_diesel, mobile_combustion_gasoline, purchased_electricity, purchased_goods_spend, refrigerant_hfc_134a, refrigerant_hfc_32, stationary_combustion_diesel, stationary_combustion_natural_gas, stationary_combustion_propane, waste_landfilled_mixed_msw.",
      +        "examples": [
      +          "purchased_electricity"
      +        ],
      +        "title": "Activity Type"
      +      },
      +      "id": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Your label for this line; it is echoed in the result.",
      +        "title": "Id"
      +      },
      +      "mobile_source_class": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Only for mobile fuels: nonroad_four_stroke for mobile_combustion_gasoline, nonroad for mobile_combustion_diesel.",
      +        "title": "Mobile Source Class"
      +      },
      +      "quantity": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Amount in `unit`, zero or more. A number or a decimal string.",
      +        "examples": [
      +          12000,
      +          "12000.5"
      +        ],
      +        "title": "Quantity"
      +      },
      +      "region": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Where it happened. One of: GLOBAL, UK, US, US-CAMX, US-ERCT. US-CAMX is the California grid and US-ERCT the Texas grid (electricity only); use US elsewhere in the United States; GLOBAL is for refrigerants.",
      +        "examples": [
      +          "US"
      +        ],
      +        "title": "Region"
      +      },
      +      "unit": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Unit of `quantity`. Electricity: kWh or MWh. Natural gas: therm, mmbtu or kWh. Liquid fuels: gallon_us or litre. Refrigerants: kg or lb. Landfilled waste: short_ton or metric_tonne. Car travel: mile or km. Purchased goods by spend: usd.",
      +        "examples": [
      +          "kWh"
      +        ],
      +        "title": "Unit"
      +      },
      +      "year": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The year the activity took place. The latest bundled factor dated on or before it is used and recorded on the line.",
      +        "examples": [
      +          2025
      +        ],
      +        "title": "Year"
      +      }
      +    },
      +    "title": "Activity",
      +    "type": "object"
      +  }
      +}
    • changedInput schema / properties / activities / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "$ref": "#/$defs/Activity"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "$ref": "#/$defs/Activity"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  7. Changed5 schema fields changed
    • addedInput schema / properties / activities / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / activities / default
      Added value: +null
    • removedInput schema / properties / activities / items
      Removed value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}
    • removedInput schema / properties / activities / type
      Removed value: -"array"
    • removedInput schema / required
      Removed value: -[
      -  "activities"
      -]
  8. Changed1 schema field changed
    • addedInput schema / properties / request_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Request Id"
      +}
  9. Changed1 schema field changed
    • addedInput schema / properties / payment_ref
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Payment Ref"
      +}
  10. First observed

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 closed-world, and the description still adds substantially: it enumerates the returned artifacts (per-line gas/CO2e, Scope 1/2/3 and category rollups, dual Scope 2, indeterminate lines, factor lineage, notary payload, offset dry-run), discloses paid pricing after 10 free calls/day with three payment routes, and explains factor-vintage selection. That is exactly the behavioral context annotations cannot express.

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?

Purpose and return contents are front-loaded, followed by pricing, then input requirements, then an example — a sensible order. The payment sentence is long and enumerates three routes, and the example partly restates schema constraints, but no sentence is filler for an agent deciding whether and how to call.

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?

With an output schema present and full param coverage, the description needs only purpose, preconditions and edge behavior — all of which it supplies, including payment mechanics, idempotent retry via request_id, and the indeterminate-lines fallback. Nothing material is left for the agent to guess before invoking.

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 schema already defines activities, options, request_id and payment_ref in depth; baseline is 3. The description still earns credit by stating that a single activity object is accepted as a list of one, that the on-or-before-it factor vintage gets recorded on the line, and by supplying a concrete two-activity example the agent can pattern-match.

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?

"Calculate an auditable GHG inventory from explicit activity records" names a specific verb and resource, and immediately frames the boundary ("This is calculation, not advice"). It also positions a sibling, list_factor_packs, as the source of valid activity types and regions, so the agent can tell what this tool does and does not resolve.

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?

It states the input precondition (each activity needs activity_type, quantity, unit, region and year) and what the year field selects, plus what to do when a call comes back indeterminate (look for first_call_help). What is missing is routing against the sibling classify_activity, which is plausibly the right tool when the activity type is unclear; no exclusion or alternative is named for that case.

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.