Skip to main content
Glama

Estimate the cost of runs

estimate_cost
Read-onlyIdempotent

Estimate what a number of runs of one task will cost before starting them, from this organization's settled runs of the same task with the same model (the same saved workflow, or the same prompt) in the history: per_run and total give typical (median), high (90th percentile) and cap (max_cost_micros, the most a run can cost). basis.matched_runs says how many runs the range comes from; with none, only the cap is known, so start one or a few runs first and estimate again. Nothing is started or charged. On the hosted service a run costs a run fee once its worker starts, compute per second, model calls at the provider's price plus a percentage, and web requests and searches at flat prices; get_account (REST: GET /v1/me) reports the rates.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "estimate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
runsNoHow many runs (default 1).
modelNoA model id from list_models. Omit for the workflow's or the default.
promptNoAn inline prompt, as create_run takes it.
workflowNoName of a saved workflow (see list_workflows). Give a workflow or a prompt.
max_cost_microsNoThe cap each run would have (default default_max_cost_micros).
zero_data_retentionNoWhether the runs would be zero-data-retention runs, which keep no history to estimate from.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses that nothing is started or charged, that estimates derive from the organization's settled historical runs with the same model, that a zero-data-retention run leaves no history to estimate from, and it breaks down the hosted pricing components. These are behavioral facts the annotations cannot convey.

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?

Purpose is front-loaded in the first clause and the no-data caveat plus the 'nothing is started or charged' assurance come early. The trailing pricing breakdown is useful but dense and colon-chained, making the single paragraph heavier than necessary.

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

Completeness5/5

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

There is no output schema, yet the description explains the return shape (per_run and total with median/90th-percentile/cap, plus basis.matched_runs) and what happens when no runs match. For a zero-required-parameter estimation tool this covers everything an agent needs to call and interpret it.

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 adds real meaning: max_cost_micros is described as the per-run cap whose maximum is the reported 'cap', workflow vs prompt is explained as an either/or, and model matching is tied to the estimation basis. It stops short of describing defaults for runs or zero_data_retention beyond what the schema says.

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 and resource ('Estimate what a number of runs of one task will cost') and pins the scope to before execution, which cleanly separates it from create_runs/create_run and list_runs. The parenthetical 'the same saved workflow, or the same prompt' further disambiguates which task is being estimated.

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 a clear usage context ('before starting them') and an explicit fallback rule: when basis.matched_runs is zero, 'start one or a few runs first and estimate again.' It also routes the agent to get_account (REST: GET /v1/me) for actual rates. There is no explicit when-not guidance versus other cost-related siblings, which keeps it just 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.

Resources