Skip to main content
Glama
pozii
by pozii

advise_context_window

Analyze token usage against model context window and get recommendations on which parts to trim to reduce API costs.

Instructions

Analyze current token usage vs model context window and recommend what to trim. Use this meta-tool to know WHERE to apply compress_context, prune_conversation, or other tokensaver tools for maximum effect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel name (e.g. "claude-sonnet-4", "gpt-4o", "gemini-1.5-pro").
current_tokensYesCurrent total tokens being sent (use count_tokens first).
messagesNoOptional conversation history for per-turn breakdown.
target_utilizationNoFraction of context window to target (default 0.75 = 75%).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

The description discloses that the tool analyzes and recommends, but omits details about the output format, whether it is read-only, or any side effects. Since no annotations are provided, the description carries the full burden; more specifics on what 'recommend' entails would improve transparency.

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 description is two sentences long, with the first sentence stating the core function and the second providing usage context. It is front-loaded and every word adds value.

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?

Given the comprehensive input schema and the presence of an output schema (not detailed but noted), the description provides sufficient context for tool selection. It mentions sibling tools and usage context. Minor gap: it could briefly describe the output structure, but the existing output schema compensates.

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?

The schema has 100% description coverage, so the baseline is 3. The description adds no additional meaning beyond the schema's parameter descriptions; it does not elaborate on how parameters like 'current_tokens' or 'target_utilization' are used.

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 identifies the tool as a meta-tool that analyzes token usage and recommends trimming actions. It distinguishes itself from sibling tools like compress_context and prune_conversation by positioning itself as a diagnostic step before applying those tools.

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 explicitly tells when to use this tool: before applying compression tools, and it names specific sibling tools (compress_context, prune_conversation) as targets. It does not provide explicit 'when not to use' guidance, but the context is clear enough for appropriate selection.

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/pozii/tokensaver'

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