Skip to main content
Glama

estimate_context_cost

Estimate LLM token cost of pending Git changes with a file-by-file breakdown, optionally restricted to staged changes.

Instructions

Analyzes pending working tree changes and breaks down estimated LLM token consumption file-by-file.

Input Schema

NameRequiredDescriptionDefault
staged_onlyNoWhether to analyze only staged changes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.2/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 implies a read-only analysis (no mutation language), and 'pending working tree changes' signals it reads the live working tree rather than commits. However, it says nothing about whether it's expensive to run, how tokens are estimated, or what the breakdown contains.

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?

A single front-loaded sentence with no filler. Compact and easy to scan, though it borders on too terse for an analysis tool with no output schema.

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?

The tool is simple (one optional boolean, full schema coverage), but there is no output schema and the description doesn't describe the shape of the file-by-file breakdown or what 'estimated token consumption' entails. An agent knows enough to invoke it but not what to expect back.

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 coverage is 100%, so staged_only is already documented. The phrase 'pending working tree changes' hints that the default scope includes unstaged work, loosely aligning with staged_only=false, but the description adds no further semantic detail beyond the schema.

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?

States specific verbs (analyzes pending working tree changes, breaks down estimated token consumption) with the level of granularity (file-by-file). It's clearly distinguishable from siblings like smart_diff or scan_secrets, though it doesn't explicitly say so.

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

Usage Guidelines2/5

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

No guidance on when to reach for this versus smart_diff or inspect_branch, and no mention of when the staged_only variant applies. The agent must infer usage from the name alone.

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