Skip to main content
Glama

ai.estimate_cost

Read-only

Price an AI task BEFORE running it: provider passthrough at wholesale cost, no markup — the per-token platform fee is retired, so text/reasoning passes through at cost. Anonymous — open catalog includes open pricing. Returns integer micro-USD plus a USD total. NEXT: run the action, then ai.budget to watch the runway.

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": "<task>"
    },
    "name": "ai.estimate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskYesA token-billed task name from the platform task→model map (e.g. 'assistant.ask').
tokens_inNoEstimated input tokens (default 1000).
tokens_outNoEstimated output tokens (default 500).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

The readOnlyHint=true annotation is consistent with a pricing/estimation tool. The description adds meaningful context beyond annotations: wholesale passthrough pricing, no markup, anonymous access, open pricing, and a return format of integer micro-USD plus USD total. It does not cover error behavior or rate limits, but the key behavioral traits are disclosed.

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?

The description is front-loaded with the core action and followed by pricing context, return format, and next steps. It is somewhat dense and includes marketing-style pricing context, but most sentences add useful information for invocation.

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 a simple three-parameter estimation tool with full schema coverage and no output schema, the description covers purpose, pricing semantics, return format, anonymity, and next steps. It is nearly complete, though it could mention unknown-task behavior or error cases.

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%, so the input schema already documents the task, tokens_in default, and tokens_out default. The description does not add syntax or usage details beyond the schema; 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?

States a specific verb and resource: 'Price an AI task BEFORE running it.' It clearly distinguishes the tool from the sibling ai.budget by positioning itself as pre-execution estimation and ai.budget as post-run runway monitoring.

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 explicit sequencing: use this before running the action, then use ai.budget afterward to watch the runway. It does not explicitly state exclusions or failure cases, but the primary usage context and alternative are clear.

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