Skip to main content
Glama

Estimate generation cost

estimate_generation
Read-onlyIdempotent

Estimate the credits one generation would cost and compare it with the current balance. It validates the parameters exactly like the generation tool but does not generate media or deduct credits. Media inputs of models priced by input length are downloaded and measured first.

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_generation"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoModel ID. Omit to use the default model of the operation.
paramsNoThe arguments the generation tool would receive (top-level fields and extras).
operationNoWhich generation the estimate is for: image, video, speech, audio (music, or a sfx/ model), upscale, video_upscale, transcribe, media_import or html_video (params.method render, or generate / edit for generate_html_video). Optional when model is given. For social URLs, media_import estimates upload_asset with params url, type audio/video, quality and max_duration, and transcribe estimates social caption retrieval including its automatic audio fallback; both read the source length from metadata without downloading and return the full prepaid reservation. frame_interpolation estimates increase_frame_rate (params video_url plus extras target_fps, slowdown_factor) and lip_sync estimates lip_sync_video (params video_url, plus audio_url and model when given). swap_video_characters quotes its price with its free previews, so call it directly.
skills_usedNoOptional workflow analytics: names of the skills (or skill/reference paths) followed for this call. Stored with generation jobs only. Never include private data, local paths or media URLs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses three non-obvious behaviors: parameters are validated identically to the real generation tool (so a failure here predicts a failure there), no credits are deducted, and 'media inputs of models priced by input length are downloaded and measured first' — a network side effect an agent would not otherwise expect from a read-only estimate.

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 sentences, each doing distinct work: what it returns, how it differs behaviorally from generation, and the one surprising side effect. The cost/balance outcome is front-loaded and there is no filler.

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?

There is no output schema, but the description conveys the return content as a credit estimate paired with the current balance, which is enough for an agent to act on. Given a rich, fully described input schema and comprehensive annotations, the remaining gap — exact response shape or how the comparison is expressed — is minor.

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

Parameters3/5

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

Schema description coverage is 100% and the operation enum already documents per-value mappings in detail, so the schema carries the parameter burden. The description adds only the high-level notion that params mirror 'the arguments the generation tool would receive' and that length-priced media inputs get measured; it contributes no meaning beyond that baseline.

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?

The description states a specific verb+resource: estimate the credits a generation would cost and compare with the current balance. It clearly separates itself from the generate_* siblings by noting it 'validates the parameters exactly like the generation tool but does not generate media or deduct credits.' It does not name any sibling explicitly, so it falls just short of the top band.

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?

The pre-flight cost-check context is clear: run this to learn the credit price before committing. The 'does not generate media or deduct credits' clause implicitly points the agent to the generation tools when it actually wants output. It stops short of explicit when-not guidance, e.g. how this differs from get_credits_balance for a plain balance read.

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.