Skip to main content
Glama

estimate_cost

Estimate the USD cost of an MCP tool call before invoking it, based on historical averages over the last 30 days. Use this to make spend-aware decisions and confirm with the user before expensive calls.

Instructions

Estimate the USD cost of an MCP tool call BEFORE invoking it. Returns expected cost based on the historical average for this (server, tool, model) combo in this org over the last 30 days. Use this to make spend-aware decisions — e.g. confirm with the user before calling tools that would cost more than $0.10. Returns 0 + isUnknown=true when no history exists yet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNameYesMCP server name, e.g. "playwright" or "github".
toolNameYesTool name within that server, e.g. "browser_navigate".
modelNoOptional model identifier for cost lookup. Falls back to the historical median for this tool when omitted.
Behavior4/5

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

Describes return values (expected cost, isUnknown flag) and how cost is derived: historical average for same (server, tool, model) combo over last 30 days. No annotations, so description carries burden and does well, though lacks details on cost computation boundaries.

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 plus a usage example. No fluff, every sentence earns its place. Front-loaded with purpose.

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?

Completely describes a simple tool. Explains inputs, outputs, and special case (no history). No output schema but description covers return fields adequately.

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 has 100% coverage with descriptions. Description adds value by explaining the optional model field falls back to historical median, which is not in schema. No need for more.

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?

Explicitly states it estimates USD cost of an MCP tool call before invoking. Differentiates from siblings like get_session_details, get_today_cost by focusing on cost estimation.

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?

Provides clear when-to-use: 'Use this to make spend-aware decisions — e.g. confirm with the user before calling tools that would cost more than $0.10.' Also explains behavior when no history exists. Missing explicit when-not-to-use, but context is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andreisirbu91-lab/MCPSpend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server