Skip to main content
Glama

estimate_from_usage

Estimate water consumption in milliliters from OpenAI or Anthropic API usage data. Accepts both chat and responses formats, handling reasoning and cached tokens accurately without double counting.

Instructions

Estimate water (mL) from a real API usage object — the accurate path.

usage accepts OpenAI Chat Completions shape (prompt_tokens / completion_tokens, with completion_tokens_details.reasoning_tokens and prompt_tokens_details.cached_tokens), OpenAI Responses shape, or Anthropic Messages shape (input_tokens / output_tokens, cache_read_input_tokens, cache_creation_input_tokens). Reasoning and cached tokens are handled without double counting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
usageYes
regionNo
include_embodiedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the burden and adds meaningful behavior: it enumerates supported OpenAI/Anthropic usage shapes and explicitly states that reasoning and cached tokens are handled without double counting. It does not discuss failure modes, but the pure estimation nature and output schema reduce that need.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two front-loaded sentences: the first states the purpose and positioning, the second enumerates the supported usage shapes. Every sentence earns its place, and the density is acceptable given the complex accepted formats.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema covers return values, and the usage-shape details are strong. However, the description leaves `model`, `region`, and `include_embodied` to their bare schema titles, and given the sibling list_known_models, model semantics are relevant context that is missing.

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 0%, and the description richly documents the nested `usage` shape including prompt_tokens, completion_tokens, and cache fields. However, it adds nothing about the required `model` parameter or optional `region` and `include_embodied`, so parameter semantics are only partially compensated.

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 states a specific verb and resource: 'Estimate water (mL) from a real API usage object', and 'the accurate path' distinguishes it from the sibling estimate_water tool. It is not a tautology and clearly identifies the tool's domain.

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?

The description gives clear context: use this tool when you have a real API usage object and want the accurate estimate. It does not explicitly name alternatives or state when-not-to-use, so it stops short of full exclusion guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Unchained-Labs/soif-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server