Skip to main content
Glama

estimate_cost

Read-onlyIdempotent

Stateless dry-run cost and route-eligibility estimator. Validates the exact generation request and computes per-route estimatedCostMicros, recommendedMaxCostMicros, and workspaceEligibility without reserving credits, creating a quoteId, or calling upstream providers. Read-only.

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

Input Schema

NameRequiredDescriptionDefault
inputYesCanonical generation input object ({ prompt, resolution, duration, aspectRatio, count, quality, ... }).
billingNoBilling mode.
modelIdYesExact model ID.
routeIdNoOptional pinned route ID.
routingNoOptional routing constraints ({ providerIds, endpointRegions, fallback, preference }).
operationYesExact generation operation.
maxCostMicrosNoOptional spend ceiling in integer micro-USD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond readOnly/idempotent/non-destructive annotations, it explicitly states the tool is stateless, does not reserve credits, does not create a quoteId, and does not call upstream providers. That is meaningful side-effect disclosure for a preflight estimator, though it does not discuss auth or failure behavior.

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?

The description is front-loaded and compact: purpose first, then outputs and side-effect exclusions. The final 'Read-only' sentence is slightly redundant with annotations but does not add meaningful bloat.

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 usefully names the returned fields (estimatedCostMicros, recommendedMaxCostMicros, workspaceEligibility) and clarifies that no credits or upstream calls are involved. It is complete enough for a stateless estimator, though route-eligibility criteria and error behavior are left implicit.

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 coverage is 100%, and the schema already documents all seven parameters including enums and nested input/routing objects. The description adds little parameter-level meaning beyond 'exact generation request,' so baseline 3 is appropriate.

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?

The description gives a specific verb/resource ('cost and route-eligibility estimator'), states the dry-run scope, and identifies the exact generation request it validates. It also names the computed outputs, so an agent can distinguish it from sibling tools like balance or analytics 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?

The 'dry-run' and 'validates the exact generation request' wording clearly implies preflight use before committing a generation, and it distinguishes this from an operation that reserves credits or creates a quote. However, it does not explicitly say when to choose it over siblings or state exclusions/failure handling.

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.