Skip to main content
Glama

Estimate agent cost

estimate_cost
Read-only

Estimate the monthly API cost of an AI agent or chatbot on one model. Easiest: pass model + preset (chatbot, rag, coding_agent, research_agent). Or give input_tokens, output_tokens and calls_per_day (plus optional steps_per_task, cached_percent); explicit numbers override the preset.

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": {
      "model": "<model>"
    },
    "name": "estimate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesModel id like anthropic/claude-sonnet-5.5, or a name like "Grok 4.7"
presetNoOptional workload preset that fills in token defaults: chatbot, rag, coding_agent, research_agent. Explicit numbers override it.
input_tokensNoInput tokens per call/step
calls_per_dayNoCalls (or agent tasks) per day
output_tokensNoOutput tokens per call/step
cached_percentNoShare of input billed at the cached price, 0-100 (default 50 if steps_per_task>1, else 0)
steps_per_taskNoModel calls per task for multi-step agents (default 1)
reasoning_ratioNoHidden reasoning tokens per output token, billed at the output price, on reasoning-capable models only (default: the preset's value, 0.9 for agent presets and custom workloads, 0 for chatbot; 0 excludes reasoning)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / reasoning_ratio
      Added value: +{
      +  "description": "Hidden reasoning tokens per output token, billed at the output price, on reasoning-capable models only (default: the preset's value, 0.9 for agent presets and custom workloads, 0 for chatbot; 0 excludes reasoning)",
      +  "type": "number"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint=false, so the safety profile is covered. The description adds the override precedence and the fact that the result is a monthly estimate, but says nothing about pricing currency, staleness of model prices, or whether the estimate is a single number or a breakdown.

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-loaded with the outcome, then the preferred preset path, then the manual path with the override rule. Dense and mostly waste-free, though the parenthetical enumerations and semicolon chaining make it slightly harder to scan than it needs to be.

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?

For a read-only, no-output-schema calculation tool with fully documented parameters, the description covers both valid input modes and precedence rules. Only the shape of the returned estimate (single figure vs. breakdown) is left implicit.

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 goes further by explaining how preset and explicit numbers combine (explicit overrides preset) and which fields are needed for the manual workload path. That combination semantics is meaningfully beyond the per-parameter schema text.

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 (monthly API cost) scoped to a single model and workload type. It is distinguishable from price-lookup siblings like get_model_price because 'monthly' and 'agent/chatbot' scope the output, though no sibling is named explicitly.

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?

Gives clear in-tool guidance on two invocation paths: the 'easiest' model+preset route and the manual token/calls route, including the override precedence. It does not say when to choose this over compare_models or get_model_price, so it falls short of a 5.

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.