Skip to main content
Glama

Estimate a run's cost

estimate_cost

Credits a run_benchmark call would use, before spending anything: the expected total, the split per model, the balance needed to start, the worst case, and the user's balance. Same inputs and run settings as run_benchmark. Use it to drop an expensive model, or to compare settings (e.g. max_tokens), before running.

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

Input Schema

NameRequiredDescriptionDefault
modelsYes
presetNoLike the app's presets: standard = 2 passes + snappy timeouts (the default), thorough = 3 passes + patient timeouts. Explicit stability_runs / timeout_profile override it
fail_fastNoStop a model after repeated errors to save credits. Set false to let every model finish, e.g. to diagnose failures
task_yamlYesThe full task YAML (a JSON object with the same fields also works)
max_tokensNoOutput token limit per answer, 16 to 16000; 0 = no limit. Keep the default unless results show it was too low: a higher limit raises the credits needed to start. get_results flags models whose answers came back empty or near the limit; re-run those with a higher value
upload_uidNoFrom prepare_attachments, so image and document tokens are counted
custom_timeoutNoSeconds per answer, with timeout_profile custom
stability_runsNoPasses per model; 2+ shows which models are consistent
temp_preferenceNoWith temperature_discovery: which temperature wins a tielow
timeout_profileNoHow long to wait per answer: snappy 45s, patient 90s, custom = custom_timeoutsnappy
temperature_discoveryNoFind each model's best temperature for this task. Costs about 6x as much

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / max_tokens / default
      Previous value: -500New value: +1000
  2. Changed9 schema fields changed
    • addedInput schema / properties / custom_timeout
      Added value: +{
      +  "description": "Seconds per answer, with timeout_profile custom",
      +  "maximum": 600,
      +  "minimum": 120,
      +  "type": "integer"
      +}
    • addedInput schema / properties / fail_fast
      Added value: +{
      +  "default": true,
      +  "description": "Stop a model after repeated errors to save credits. Set false to let every model finish, e.g. to diagnose failures",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / max_tokens
      Added value: +{
      +  "default": 500,
      +  "description": "Output token limit per answer, 16 to 16000; 0 = no limit. Keep the default unless results show it was too low: a higher limit raises the credits needed to start. get_results flags models whose answers came back empty or near the limit; re-run those with a higher value",
      +  "maximum": 16000,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / preset
      Added value: +{
      +  "description": "Like the app's presets: standard = 2 passes + snappy timeouts (the default), thorough = 3 passes + patient timeouts. Explicit stability_runs / timeout_profile override it",
      +  "enum": [
      +    "standard",
      +    "thorough"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / stability_runs / description
      Added value: +"Passes per model; 2+ shows which models are consistent"
    • changedInput schema / properties / stability_runs / maximum
      Previous value: -3New value: +5
    • addedInput schema / properties / temp_preference
      Added value: +{
      +  "default": "low",
      +  "description": "With temperature_discovery: which temperature wins a tie",
      +  "enum": [
      +    "low",
      +    "high"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / temperature_discovery
      Added value: +{
      +  "default": false,
      +  "description": "Find each model's best temperature for this task. Costs about 6x as much",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / timeout_profile
      Added value: +{
      +  "default": "snappy",
      +  "description": "How long to wait per answer: snappy 45s, patient 90s, custom = custom_timeout",
      +  "enum": [
      +    "snappy",
      +    "patient",
      +    "custom"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the safety burden and does well: 'before spending anything' makes clear this is a non-spending, side-effect-free estimate, and the enumerated return fields reveal the result shape in the absence of an output schema. It does not cover failure modes, auth, or rate limits, so it stops short of fully complete.

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 core purpose and return contents, then the operational guidance. The return-value list is dense but earns its place because no output schema exists.

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 an 11-parameter tool with no annotations and no output schema, the description covers purpose, return shape, cost-free nature, and parameter equivalence to run_benchmark — enough to call it correctly. Minor gaps remain around error behavior and whether a valid task must already exist.

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 already 91%, so the baseline is 3, but the description adds real meaning by telling the agent the inputs and run settings are identical to run_benchmark — an agent can reuse a known parameter set rather than re-deriving it. It also ties max_tokens to credit impact in the usage example.

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 — estimates the credits a run_benchmark call would consume — and enumerates exactly what it returns (expected total, per-model split, balance needed to start, worst case, user's balance). Naming run_benchmark as the call being priced immediately distinguishes it from that sibling.

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 pre-flight guidance: use it to drop an expensive model or to compare settings such as max_tokens before running. The alternative (actually running) is implied by 'before running' and by the run_benchmark reference, but no explicit when-not or prerequisite is spelled out.

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