Skip to main content
Glama

estimate_cost

Estimate a run's typical and maximum USD cost and prompt token usage before execution, without making API calls or spending money; unpriced models return null costs.

Instructions

Estimate the cost of a run with no API call and no spend.

Returns typical and maximum cost in USD, the prompt token estimate, and the per-token pricing used. An unpriced model returns priced false and null costs.

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

Input Schema

NameRequiredDescriptionDefault
modelYes
max_tokensNo
n_findingsNo
text_length_charsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description does real work: it discloses that the call has no side effects and no spend, describes the return payload (typical and maximum cost in USD, prompt token estimate, per-token pricing), and covers an edge case (unpriced model yields priced false and null costs). The only omissions are trivial for a pure-computation tool.

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?

Three short sentences, front-loaded with the key guarantee (no call, no spend), then return shape, then the edge case. Nothing redundant and nothing buried.

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?

An output schema exists, so the return-value sentences are a bonus rather than a necessity. The gap is on the input side: for a four-parameter tool with zero schema descriptions, leaving max_tokens and n_findings undefined makes it hard to know how to get a meaningful estimate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and there are four parameters, so the description must compensate. It only touches 'model' (via the unpriced-model edge case) and implicitly 'text_length_chars' (via the prompt token estimate); 'max_tokens' and 'n_findings' are never mentioned despite both plausibly changing the cost estimate.

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+resource ('Estimate the cost of a run') and immediately scopes it with 'no API call and no spend'. No sibling in the list is cost-related, so the tool is trivially distinguishable from check_osv_advisory, repo_scan, and the rest.

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 phrase 'with no API call and no spend' implicitly signals this is a pre-flight/preview operation rather than an execution step, which is useful. However, it never explicitly says when to reach for it (e.g. before launching a run) or what to use instead when actually running the job, so the guidance is implied rather than stated.

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