Skip to main content
Glama

Estimate an AI session's footprint from token counts

estimate_session_footprint
Read-onlyIdempotent

Estimate the water and energy of an AI session (e.g. an agent or coding-assistant run) from its token usage. Pass the SUM across all model calls: input_tokens (uncached prompt tokens), output_tokens (including any reasoning/thinking tokens) and cached_input_tokens (prompt-cache reads). model_class: 'small' (Haiku/mini/Flash-class), 'frontier' or 'reasoning'. Returns a central estimate and a 0.3x–3x range – this is an order-of-magnitude estimate calibrated to published per-prompt figures, not a measurement.

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": {
      "input_tokens": "<input_tokens>",
      "output_tokens": "<output_tokens>"
    },
    "name": "estimate_session_footprint"
  }
}

Input Schema

NameRequiredDescriptionDefault
boundaryNoAccounting boundary: 'onsite' = data-centre cooling water only (as vendors report); 'comprehensive' = also counts water used to generate the electricity (the wider boundary most researchers use).comprehensive
model_classNoModel size: 'small' = Haiku/mini/Flash-class, 'frontier' = flagship models, 'reasoning' = extended-thinking models.frontier
input_tokensYesUncached input (prompt) tokens, summed across every model call in the session.
output_tokensYesOutput tokens, including any reasoning/thinking tokens, summed across every model call.
cached_input_tokensNoPrompt-cache read tokens, summed across every model call. 0 if unknown.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / boundary / description
      Added value: +"Accounting boundary: 'onsite' = data-centre cooling water only (as vendors report); 'comprehensive' = also counts water used to generate the electricity (the wider boundary most researchers use)."
    • addedInput schema / properties / cached_input_tokens / description
      Added value: +"Prompt-cache read tokens, summed across every model call. 0 if unknown."
    • addedInput schema / properties / input_tokens / description
      Added value: +"Uncached input (prompt) tokens, summed across every model call in the session."
    • addedInput schema / properties / model_class / description
      Added value: +"Model size: 'small' = Haiku/mini/Flash-class, 'frontier' = flagship models, 'reasoning' = extended-thinking models."
    • addedInput schema / properties / output_tokens / description
      Added value: +"Output tokens, including any reasoning/thinking tokens, summed across every model call."
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description still adds meaningful context beyond them: it discloses the return shape (central estimate plus a 0.3x–3x range) and explicitly frames the result as an order-of-magnitude estimate calibrated to published figures rather than a measurement, which sets correct expectations about precision.

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-loads the core purpose and the input-aggregation rule, then the model_class options, then the uncertainty caveat. Dense but every clause carries information; only minor redundancy with the schema keeps it from a 5.

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?

With no output schema, the description usefully explains what comes back (central estimate and range) and its reliability. The boundary parameter is left entirely to the schema, but since that schema entry is fully documented, the definition is complete enough to call correctly.

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 the baseline is 3. The description restates the aggregation semantics (sum across all model calls, output includes reasoning tokens, cached = prompt-cache reads) and gives model_class examples, but this largely duplicates what the schema already documents and adds no new format or edge-case detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (estimate) and resource (water and energy footprint of an AI session) plus the input basis (token usage). It is clearly distinguishable from a generic footprint tool, though it never names or contrasts the siblings estimate_ai_footprint or compare_water_use.

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?

Gives real usage instruction on how to supply inputs ('Pass the SUM across all model calls') and how to pick model_class, which is genuinely helpful. However, it offers no when-to-use/when-not guidance relative to the sibling estimation and comparison tools, leaving the agent to infer the choice.

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.