Skip to main content
Glama

measure_context

Measure token usage and budget status for CLAUDE.md, AGENTS.md, Cursor rules, and prompts to identify oversized context and get per-file counts plus reduction suggestions.

Instructions

Use when CLAUDE.md, AGENTS.md, Cursor rules, or prompts may be too large or consuming too much context. Input: optional suggest, stale, and staleGlob booleans. Returns JSON token totals, per-file counts, baseline deltas, budget status, suggestions, and optional stale-reference findings. Runs offline and only reads the current working directory.

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": "measure_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
staleNo
suggestNo
staleGlobNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does so well: it discloses that the tool 'runs offline and only reads the current working directory,' establishing a read-only, local-only safety profile, and it enumerates the returned JSON fields. It doesn't state whether any files are written or how token counting is performed, leaving a small gap.

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?

Three sentences, front-loaded with the trigger condition, then inputs, then outputs and runtime constraints. Every clause carries information and there is no padding.

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 small, zero-required-parameter tool with no output schema, the description covers trigger, inputs, return shape, and execution environment. The only real deficiency is the under-specified parameter meanings, which keeps it from a 5.

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

Parameters2/5

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

All three parameters have 0% schema description coverage, so the description must compensate. It only names them as 'optional suggest, stale, and staleGlob booleans' and hints that 'stale' produces 'stale-reference findings'; the meaning and effect of 'suggest' and 'staleGlob' (likely a glob pattern, despite being typed boolean) remain unexplained.

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 makes clear this is a measurement tool for context files (CLAUDE.md, AGENTS.md, Cursor rules, prompts) and names the outputs (token totals, per-file counts, budget status). The verb is implicit rather than stated ('Use when...' plus a returns list), and no sibling tool is named for contrast, so it stops short of a 5.

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?

It gives a concrete trigger condition: use when context files or prompts 'may be too large or consuming too much context.' There are no explicit exclusions or pointers to the sibling tools (context_budget_plan, context_budget_verify, trim_to_budget), so the agent must infer when to measure versus plan/verify/trim.

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