Skip to main content
Glama

Model Ruler — AI Cost Calculators

agent-loop-cost-calculator

Use when a user is running multi-step LLM agents and needs cost per successful task. Accounts for failure overhead and context growth across turns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoLLM model (default claude-sonnet-4-6)
providerNoLLM provider (default anthropic)
success_rateNoTask success rate 0-1 (default 0.7)
steps_per_taskNoAvg reasoning steps per task (default 5)
tasks_per_monthYesTasks attempted per month
tool_calls_per_stepNoAvg tool invocations per step (default 2)
context_growth_factorNoMultiplier on input tokens as conversation grows (default 1.4)
avg_tokens_in_per_turnNoAvg input tokens per turn (default 3000)
avg_tokens_out_per_turnNoAvg output tokens per turn (default 400)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose two modeling behaviors beyond the schema: failure overhead and context growth across turns. However, it never states that this is a pure read-only computation with no side effects, nor what the returned figure represents (currency, breakdown, per-task vs per-month), which matters for a 9-parameter estimator.

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?

Two sentences, no waste, and the usage trigger is front-loaded before the modeling caveat. Nothing could be cut without losing meaning.

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?

For a 9-parameter tool with no annotations and no output schema, the description is thin: it does not explain what the tool returns, whether model/provider pricing is looked up or assumed, or how the failure and context-growth adjustments are applied. The schema covers inputs fully, but the return-value burden falls on a description that doesn't carry it.

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 schema already documents all nine parameters and their defaults; baseline is 3. The description gestures at two of them ('failure overhead' ≈ success_rate, 'context growth' ≈ context_growth_factor) but adds no syntax, units, or guidance beyond what the schema provides.

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 description states a specific computation ('cost per successful task') and a specific scenario ('multi-step LLM agents'), which separates it from siblings like provider-cost-calculator or token-counter. It never names or contrasts a sibling explicitly, so an agent must infer the boundary, but the verb+resource are unambiguous.

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?

'Use when a user is running multi-step LLM agents and needs cost per successful task' is an explicit trigger condition, not an implied one. There is no when-not guidance and no named alternative among the eleven sibling calculators, so it falls short of a 5.

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