Skip to main content
Glama

Context budget

context_budget
Read-onlyIdempotent

Estimate local token budgets for steering files and tools agents load every session, for a folder or one file and its imports.

Instructions

Approximate tokens (local estimate, no network) per steering file and per tool for what loads every session: Claude Code (CLAUDE.md plus @imports up to 4 hops, rules without paths, MEMORY.md first 200 lines, skill and subagent listing), Codex (AGENTS.md, 32 KiB cap), Gemini CLI (GEMINI.md plus imports), Cursor always-applied rules, Copilot repository instructions. With path, reports one file and its imports.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "context_budget"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoOne file; omit for the whole folder

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is covered; the description still adds substantive behavior: it is an 'approximate' local estimate with no network call, imports are followed up to 4 hops, Codex has a 32 KiB cap, and MEMORY.md is only read to its first 200 lines. These qualifiers directly shape how an agent should interpret the numbers, which annotations alone cannot convey.

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?

The core claim and its caveat ('local estimate, no network') are front-loaded, followed by the platform enumeration that justifies the approximation. The long parenthetical list is dense but every element specifies a real loading rule, so nothing reads as filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-optional-parameter, read-only tool with no output schema, the description covers what is measured, what is excluded (no network), and how results are broken down (per file, per tool). Only the exact output shape of the per-tool breakdown is left unspecified, which is a minor gap given the simplicity.

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 the schema already describes path as 'One file; omit for the whole folder,' so the baseline is 3. The description reinforces and slightly extends this by stating that supplying a path also pulls in that file's imports, clarifying result scope beyond the raw parameter definition.

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 names the operation precisely — 'Approximate tokens (local estimate, no network) per steering file and per tool' — and enumerates exactly what gets counted for each agent platform. It does not explicitly contrast itself with siblings like find_steering_files or lint_steering, but the verb-plus-resource framing makes its distinct job evident.

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

Usage Guidelines3/5

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

'With path, reports one file and its imports' and 'omit for the whole folder' give clear usage for the two parameter modes, which is real guidance. However, there is no explicit when-to-use routing against alternatives (e.g., locating files first with find_steering_files, or when a budget estimate is warranted versus a lint check), so usage is implied rather than stated.

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