Skip to main content
Glama

Estimar costo de llamadas x402

x402-cost-estimate
Read-onlyIdempotent

Estima el costo de un lote de llamadas pagadas por uso (p. ej. x402 a USD 0,001) en USD y unidades base de USDC, y cuántas llamadas cubre un presupuesto. Cuándo: hay que leer, convertir o revisar una descripción de agente, una lista de herramientas, un documento OpenAPI o un recibo según el formato de su protocolo. No para: estimar el costo de llamadas a un LLM a partir de tokens (llm-cost-estimate). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Estimates the cost of a batch of pay-per-call API requests (e.g. x402 at $0.001/call) in USD and USDC base units, after a free allowance, and how many calls a budget buys. Exact decimal math. When: an agent description, tool list, OpenAPI document or receipt has to be read, converted or checked against its protocol format. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
callsYesNumber of calls (integer; required; min 0; max 1000000000000).
budget_usdNoBudget in USD (string; optional; pattern ^\d+(\.\d{1,6})?$).
free_callsNoFree calls before charging (integer; optional; default 0; min 0; max 1000000000000).
price_per_call_usdNoPrice per call in USD (string; optional; default "0.001"; pattern ^\d+(\.\d{1,6})?$).0.001

Output Schema

NameRequiredDescriptionDefault
cost_usdNo
billable_callsNo
calls_within_budgetNo
cost_usdc_base_unitsNo
price_per_call_base_unitsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / calls / examples
      Added value: +[
      +  25000
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Estimates the cost of a batch of pay-per-call API requests (e.g. x402 at $0.001/call) in USD and USDC base units, after a free allowance, and how many calls a budget buys. Exact decimal math. When: an agent description, tool list, OpenAPI document or receipt has to be read, converted or checked against its protocol format. Not for: estimating LLM request cost from input/output token counts (llm-cost-estimate). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint=false and destructiveHint=false. The description still adds real value: 'Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado)', determinism ('la misma entrada da la misma salida') and concrete limits (64 KB input, 1 s, 1 MB result) that no annotation carries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is labeled and front-loaded (purpose, when, not-for, side effects, limits), but the Spanish block is duplicated by a deferred 'full EN: inputSchema.description' pointer, and the 'Límites: 64 KB JSON / 1 s' boilerplate plus the off-topic 'Cuándo' sentence cost space without earning it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and 100% param coverage, the core contract is covered. The remaining gap is that the when-to-use sentence points at document/receipt parsing rather than at cost/budget scenarios, and the English text lives only behind a pointer into inputSchema.description, so the definition is adequate but not self-sufficient.

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 all four parameters are documented in the schema and baseline is 3. The description adds modest semantics — 'after a free allowance' explains free_calls and 'Exact decimal math' justifies the string-typed price/budget fields — but nothing about the budget_usd/calls interaction that the schema does not already imply.

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 opening sentence names a specific verb and resource: estimate the cost of a batch of pay-per-call requests, reported in USD and USDC base units, including budget coverage. It also names the sibling it is not (llm-cost-estimate). The following 'Cuándo' clause is about reading/converting OpenAPI docs and receipts, which is unrelated to cost estimation and dilutes an otherwise clear purpose.

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

Usage Guidelines3/5

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

The explicit exclusion 'No para: estimar el costo de llamadas a un LLM a partir de tokens (llm-cost-estimate)' is a genuine routing signal. However, the positive 'Cuándo' guidance describes parsing a document or receipt, which does not match what the tool does, so the when-to-use half is misleading rather than helpful.

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