Skip to main content
Glama

Price a Call Before You Make It

ledger_price
Read-onlyIdempotent

What will this call cost? Priced from the same table the caps use.

Exists because ledger_track requires the CALLER to supply amount_cents, so an agent whose spend is capped could under-report its own cost and stay under the cap. This returns the number the enforcement path would use, so an agent can report honestly (and plan before it spends).

Cost = (tokens_in * in_rate + tokens_out * out_rate) / 1_000_000. If the model has cache rates, the standard in-rate is used, which is the conservative direction for a spend cap.

Every price carries the source it came from and the date it was read, and verified: false means the number was NOT read off the provider's own pricing page. Treat an unverified price as an estimate, not a measurement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesthe model id you are about to call (e.g. gpt-4o, claude-sonnet-4)
tokens_inNoexpected input tokens
tokens_outNoexpected output tokens, e.g. your max_tokens

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already indicate readOnlyHint and idempotentHint, but the description adds valuable behavior: the exact cost formula, the conservative treatment of cache rates, and the meaning of the 'verified' flag with the caution that unverified prices are estimates. This goes well beyond the annotations.

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 well-structured with a clear opening, rationale, formula, and caveat. Each paragraph serves a distinct purpose without redundancy. It is slightly longer than minimal but every sentence earns its place.

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?

Given an output schema exists, the description does not need to explain return structure. It covers the computation, the source/verification semantics, and the reason for existence, which is sufficient for an agent to call it correctly and interpret results.

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 100% and each parameter is described in the schema. The description adds the cost formula showing how tokens_in and tokens_out are used, and clarifies that the model id is the one being called. This enriches the schema definitions with practical meaning.

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 opens with 'What will this call cost?' and states it is priced from the same table the caps use, giving a specific verb and resource. It also explains why it exists (ledger_track requires caller-supplied amount_cents) and distinguishes itself by returning the enforcement number. This clearly separates it from ledger_track and other siblings.

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?

It explicitly explains the problem with ledger_track and states this tool returns the number for honest reporting and pre-spend planning, implying use before a call. It does not list explicit when-not-to-use scenarios or name alternatives, but the rationale makes usage context 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.