Skip to main content
Glama
JonThads
by JonThads

estimate_cost

Estimate API costs for text prompts and optional responses, supporting OpenAI and Anthropic models.

Instructions

Estimate the API cost of sending this text as input, plus optional expected output.

Args: text: The input text/prompt model: Model name, e.g. "claude-sonnet-5", "gpt-5" expected_output_tokens: Rough guess at response length (default 0 = input only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
modelNoclaude-sonnet-5
expected_output_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations, the description carries the full burden for disclosing behavior. It does not state whether the tool is read-only, makes external network calls, or uses live pricing data. While 'estimate' implies no actual API invocation, this is not explicit, leaving significant transparency gaps.

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 efficient: a single-sentence purpose followed by a concise Args list. It is front-loaded and not overly verbose. The minor redundancy with schema defaults (e.g., default values repeated) prevents a perfect score.

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?

Given the tool's low complexity and the presence of an output schema, the description is adequate for basic usage. However, it lacks guidance on when to choose this tool over siblings like compare_models_cost, and offers no behavioral notes (e.g., whether it requires network access). These are notable gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has zero descriptive coverage, but the description compensates fully. It explains the 'text' parameter as 'input text/prompt', gives concrete model name examples, and clarifies 'expected_output_tokens' as a rough guess at response length with a default of 0 meaning input only. This adds meaning beyond the schema.

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 clearly states the tool's function: 'Estimate the API cost of sending this text as input, plus optional expected output.' It uses a specific verb ('estimate') and resource (API cost), and distinguishes itself from sibling tools like count_tokens and compare_models_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?

The description provides clear context for when to use the tool: when an API cost estimate is needed for an input text and optional output length. However, it does not explicitly mention alternatives or exclusions relative to sibling tools, 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.

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/JonThads/tokenomics'

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