Skip to main content
Glama

Estimate run cost

estimate_run_cost
Read-onlyIdempotent

Estimate what one run of a pipeline will charge the credit balance, which steps the money goes to (lines, each clip-priced step with the length it was priced over in basis), the files it works on (sources: name, length, size, and whether each was uploaded or made with a model), and whether the current balance covers it. Estimates use the draft graph, the same one run_pipeline executes, with inputs applied: pass the same inputs the run will get (a File node's URL changes what a clip-priced step costs), or the price is for the values saved on the canvas. When a video step would render the same clip for far less on Veo 3.1 Lite, cheaper names it with the run's price on it. When the balance covers neither, preview prices a first look it does cover: the first video step alone as a short Veo 3.1 Lite clip, which run_pipeline with preview: true renders. Call this before running a pipeline you built or changed in this conversation, tell the person the price (and the preview's, when there is one), and wait for their go-ahead before run_pipeline. Pass the returned quoteId to run_pipeline: it starts the run at this price once, and refuses if the pipeline changed since (estimate again then). Clients that show panels put the estimate in front of them with a Start render button, which sends that go-ahead as their message.

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": {
      "pipelineId": "<pipelineId>"
    },
    "name": "estimate_run_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputsNoThe inputs run_pipeline will be given, keyed by entry node id the same way: a Text Input node's text, a File node's URL. The price is for a run with these, and the quote holds the run to it.
pipelineIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / inputs
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "The inputs run_pipeline will be given, keyed by entry node id the same way: a Text Input node's text, a File node's URL. The price is for a run with these, and the quote holds the run to it.",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, non-destructive, closed-world, so the bar is lower — yet the description adds substantial unannotated behavior: pricing runs against the draft graph (not a snapshot), `inputs` override canvas values, `quoteId` guarantees the run at this price once and invalidates on pipeline edits, and `preview`/`cheaper` fallbacks exist when balance is insufficient.

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?

Front-loaded with the core purpose and organized around outputs, input semantics, and the run_pipeline handoff. It is dense with nested parentheticals and long compound sentences, and the closing client-panel sentence is tangentially UI-specific, but nearly every sentence carries actionable information for a high-complexity pricing tool.

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?

Complete for a tool with no output schema: it names what the response contains (`lines`, `basis`, `sources`, `cheaper`, `preview`) and how each is used. The quote lifecycle, the input-override rule, and the human approval checkpoint are all covered, leaving nothing an agent needs to call it correctly.

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 50% (`pipelineId` is undocumented), so the description must compensate, and it largely does: it explains that `inputs` must be keyed by entry node id, that a File node's URL materially changes clip pricing, and that omitting inputs prices the values saved on the canvas. It also introduces the returned `quoteId` contract, which no schema field covers.

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 the credit charge for one pipeline run — and immediately enumerates the outputs (`lines`, `basis`, `sources`, coverage verdict, `cheaper`, `preview`). This clearly separates it from quoted-status, balance-reading, and executing siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('before running a pipeline you built or changed in this conversation'), the required human-in-the-loop step ('tell the person the price... and wait for their go-ahead'), and the downstream alternative ('before run_pipeline'), plus the stale-quote exclusion ('refuses if the pipeline changed since — estimate again then').

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.