Skip to main content
Glama
mcp-context-budget

mcp-context-budget

by yuehancn

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Measures how much of the model's context window is consumed by MCP tool schemas before the user types anything. Use it when the user asks why the agent got worse after installing more servers, or wants to know which server to remove. It probes stdio servers locally and reports token cost per server and per tool, with quantified trim suggestions. Read-only: it never edits configs and never removes servers.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
audit_context_budgetA

Measure how many tokens the configured MCP servers consume in the context window. Probes each stdio server, reads its real tools/list payload, and reports cost per server and per tool against a chosen window size. Use when the agent feels degraded after adding servers, or before installing another one. Read-only.

rank_servers_by_costA

Rank installed MCP servers by context cost without a full report. Answers 'which server should I remove first'. Cheaper and faster than audit_context_budget. Read-only.

explain_token_costA

Estimate the context cost of an arbitrary tool schema or text snippet, split by CJK versus ASCII. Use to sanity-check a schema before publishing a server, or to compare two descriptions.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4/5.0

Scored across 3 tools

Disambiguation4/5

explain_token_cost is clearly separate (arbitrary schema/text estimation) from the two server-inventory tools. audit_context_budget and rank_servers_by_cost target the same data with different depth, but the descriptions explicitly frame them as full report vs. cheap ranking, so confusion is limited though real.

Naming Consistency5/5

All three follow a clean verb_noun snake_case pattern (audit_*, rank_*, explain_*). The noun components vary sensibly with what each acts on.

Tool Count4/5

Three tools is on the thin side, but the domain (context-cost measurement) is narrow and each tool covers a distinct query pattern. No filler tools are present.

Completeness4/5

Covers the core lifecycle: full audit, quick ranking, and ad-hoc schema/text estimation. Minor gaps exist — no single-server targeted query or budget-threshold/warning configuration — but agents can reach the same answers through the provided tools.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues