Skip to main content
Glama

Estimate energy and CO2e

cloudcdn_carbon
Read-onlyIdempotent

Estimate CloudCDN traffic energy use and CO2e emissions by region and total over 1–30 days for sustainability reports or carbon-aware deploy gating.

Instructions

Estimate the energy (kWh) and emissions (grams CO2e) of CloudCDN traffic over the last N days, per region and in total, for sustainability reporting or as a carbon-aware deploy gate. For money use cloudcdn_cost, which reads the same usage: GET /api/billing/usage when the API has it (cloudcdn.pro answers 404 today), otherwise the account totals of GET /api/core/statistics as a single region named "global", with no split by region. Energy is computed locally at 0.0000001 kWh per request plus 0.0002 kWh per GB; grid intensity is a built-in average per region (400 g/kWh for a region it does not know), or the live value from api.electricitymap.org when the API tags a region with an electricity_maps_zone. Returns JSON: days; regions, each with region, requests, bandwidth_gb, compute_kwh, transfer_kwh, total_kwh, intensity_g_per_kwh, intensity_source ("static" or "electricity_maps") and co2e_g; and totals (total_kwh, total_co2e_g). With intensity-below set it also returns threshold and cleanest (the lowest regional intensity), and unless cleanest is below threshold the call fails with exit code 69, still carrying the report. Read-only. Fails: no CLOUDCDN_ACCOUNT_KEY, a JSON-RPC error; days outside 1..30, exit code 64; statistics without request and bandwidth totals, exit code 69, instead of reporting zero usage.

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": "cloudcdn_carbon"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoLook-back window in days, 1 to 30. Default 7.
regionNoOne region, as named in the region field of an earlier cloudcdn_carbon or cloudcdn_cost result, e.g. "eu-north"; passed to the billing endpoint as is. The statistics fallback ignores it and still reports "global".
intensity-belowNoDeploy-gate threshold in g CO2e/kWh, e.g. 250: the call succeeds only if some region's intensity is below it. Omit to report without gating.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.0.24
    • addedInput schema / properties / days / description
      Added value: +"Look-back window in days, 1 to 30. Default 7."
    • addedInput schema / properties / intensity-below / description
      Added value: +"Deploy-gate threshold in g CO2e/kWh, e.g. 250: the call succeeds only if some region's intensity is below it. Omit to report without gating."
    • addedInput schema / properties / region / description
      Added value: +"One region, as named in the region field of an earlier cloudcdn_carbon or cloudcdn_cost result, e.g. \"eu-north\"; passed to the billing endpoint as is. The statistics fallback ignores it and still reports \"global\"."
  2. First observedv0.0.23

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, but the description goes well beyond them: exact energy formulas (0.0000001 kWh/request, 0.0002 kWh/GB), grid-intensity sourcing (static regional average, 400 g/kWh fallback for unknown regions, electricitymap.org when tagged), and the data-source fallback when the billing endpoint 404s. It also discloses concrete failure modes and exit codes (gone without CLOUDCDN_ACCOUNT_KEY, 64 for days out of 1..30, 69 for missing totals or a failed gate). The only minor gap is that "Read-only" merely restates the annotation, and no rate limits or latency traits are mentioned.

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 units are front-loaded, and the dense sentences each carry information about computation, sourcing, returns or failure. It is long, and the digression describing cloudcdn_cost's endpoints ("GET /api/billing/usage when the API has it (cloudcdn.pro answers 404 today)...") is slightly tangled and about a sibling's internals, though it does explain where the underlying usage numbers come from.

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 no output schema, the description compensates fully by enumerating the returned JSON fields (compute_kwh, transfer_kwh, intensity_source, co2e_g, totals, plus threshold/cleanest when gating). Failure conditions, prerequisites (CLOUDCDN_ACCOUNT_KEY) and the deploy-gate exit code are all covered, so an agent can invoke and interpret results without further discovery.

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 baseline is 3, but the description adds real meaning beyond the schema: it explains that intensity-below also makes the response carry threshold and cleanest and that the call then fails with exit code 69 while still returning the report. It also confirms that region is ignored by the statistics fallback and that results come back as "global" — behavior the schema hints at but does not fully spell out.

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?

States a specific verb and resource ("Estimate the energy (kWh) and emissions (grams CO2e) of CloudCDN traffic") plus scope (last N days, per region and total) and the intended jobs (sustainability reporting, carbon-aware deploy gate). This is clearly distinguishable from cloudcdn_cost, and the units make the output 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?

Explicitly routes the agent: "For money use cloudcdn_cost" for cost questions, and this tool for carbon/energy questions. It also names the gating pattern ("carbon-aware deploy gate") and explains the intensity-below behavior, so the when-to-use boundary is drawn rather than implied.

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