Skip to main content
Glama
firstshout
by firstshout

estimate_cost

Estimates Claude API cost for Haiku, Sonnet, Opus using token counts or raw text. Supports prompt-caching ratio and multiple calls.

Instructions

Estimate Claude API cost across Haiku/Sonnet/Opus for given token counts (or raw text). Optional prompt-caching ratio.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_textNoRaw input text (used if input_tokens omitted)
input_tokensNoInput token count (overrides input_text)
output_tokensNoExpected output tokens (default 500)
cache_ratioNoFraction of input served from cache, 0-1 (cached input is 10x cheaper)
callsNoNumber of calls to project total cost for
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions models and caching but does not disclose whether the tool is read-only, requires authentication, or has rate limits. For a cost estimation tool, this is adequate but not fully transparent.

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?

The description is a single, concise sentence that front-loads the key action and resource. It is efficient with no wasted words, though it could be slightly restructured for clarity.

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

Completeness2/5

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

Given the tool has 5 parameters, no output schema, and no annotations, the description is insufficient. It does not explain the output format (e.g., per-model breakdown), mention underlying pricing, or handle edge cases, leaving significant gaps for an agent.

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 description coverage is 100%, so the schema already documents all parameters. The description adds context by naming the specific models (Haiku/Sonnet/Opus) and referencing the optional caching ratio, which goes beyond the schema details.

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 clearly states the tool estimates Claude API cost for Haiku/Sonnet/Opus models based on token counts or raw text, with optional caching. This distinguishes it from siblings like batch_savings, caching_breakeven, compare_providers, and estimate_tokens.

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?

The description implies usage for cost estimation but does not explicitly specify when to use it versus alternatives like batch_savings or compare_providers. There is no 'when not to use' 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/firstshout/claude-cost-mcp'

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