Skip to main content
Glama

Estimate generation cost

estimate_cost
Read-onlyIdempotent

Get the exact credit cost of a generation before running it, plus whether the user's balance and storage can cover it. Does not spend credits. Use list_models for valid model keys.

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

Input Schema

NameRequiredDescriptionDefault
qualityNoImage quality (image operations). Defaults to high.
modelKeyYesModel key from list_models.
operationYesThe kind of generation to price.
resolutionNoVideo resolution (video operations).
durationSecondsNoVideo duration in seconds (video operations); one the model supports, see list_models.
inputImageCountNoNumber of input images.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / durationSeconds / description
      Previous value: -"Video duration in seconds (video operations)."New value: +"Video duration in seconds (video operations); one the model supports, see list_models."
    • changedInput schema / properties / durationSeconds / maximum
      Previous value: -15New value: +30
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, but the description adds genuinely useful context beyond them: 'Does not spend credits' reassures on side effects and it discloses that the response includes affordability checks against balance and storage, not just a number. It omits behavior for invalid model keys or unsupported duration/resolution combinations.

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 primary outcome, followed by the side-effect clarification and the model-key routing hint. No filler or repetition.

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?

With no output schema, the description carries the return-value burden and does so reasonably by naming cost plus balance/storage coverage. For a 6-parameter read-only estimator it is nearly complete, though error behavior for bad keys or unsupported parameter combinations is unstated.

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 every parameter already carries a description including enum values and defaults, so the schema does the heavy lifting. The description only echoes the modelKey guidance ('Use list_models'), adding no new meaning for quality, resolution, durationSeconds, or inputImageCount.

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 ('Get the exact credit cost of a generation') and adds a second concrete output, the balance/storage affordability check, which separates it from generate_image or get_account_usage. An agent can identify exactly what this returns without opening the schema.

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 timing guidance ('before running it') and routes the agent to list_models for valid model keys. It stops short of explicitly contrasting with get_account_usage for balance questions or generate_* for actually running the generation, so the boundary is implied rather than 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