Skip to main content
Glama
donliggett

mcp-context-window

context_compact

Condense older session entries into a single summary to free context budget, keeping recent entries untouched. Preview with dry_run first.

Instructions

Fold older entries into a single summary to free budget, keeping the most recent entries verbatim. Call this when context_status or context_append warns that the session is over budget. Pinned entries are never compacted. The originals are kept on disk and can be recovered, so this is safe to run. Use dry_run first to see what would happen.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNoReport what would be compacted without doing it
session_idYesSession identifier. Reuse the same string across a task to accumulate memory.
keep_recentNoHow many of the newest entries to leave untouched (default 10)
target_tokensNoRough size of the summary produced (default 400)
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It covers key traits: pinned entries are never compacted, originals are kept on disk and recoverable, and dry_run is recommended for previewing. These are non-obvious behavioral details that an agent needs to know before calling, and they are clearly stated. The safety/reversibility disclosure is particularly strong.

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 four sentences, all essential. It front-loads the core action, then the trigger, then safety, then a recommendation. There is zero fluff; every sentence earns its place. It is compact and efficient, matching the tool's own purpose.

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 tool's complexity (4 params, 1 required, no output schema) and the rich schema descriptions, the description is nearly complete. It covers when to use, what it does, safety, and workflow advice. The only minor gap is that it doesn't mention error conditions or the exact nature of the summary, but those are not critical for an agent to call it correctly. The description complements the schema well, earning a 4.

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 the baseline is 3 per the rubric. The description adds some contextual meaning (e.g., 'keeping the most recent entries verbatim' hints at keep_recent), but it does not elaborately explain each parameter beyond what the schema already documents. The schema descriptions for each parameter are thorough, so the description's additional value is marginal but present. This aligns with the baseline for high coverage.

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 opens with a precise verb and object: 'Fold older entries into a single summary to free budget.' It immediately distinguishes the tool from siblings by specifying the compaction behavior and the criteria for what stays verbatim. This is highly specific and leaves no ambiguity about the tool's function.

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

Usage Guidelines5/5

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

The description explicitly states the trigger: 'Call this when context_status or context_append warns that the session is over budget.' It also advises using dry_run first. This gives an agent a clear, actionable condition for when to invoke the tool, and provides a safety step. No alternatives are listed, but the trigger is so specific that it satisfies the dimension.

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/donliggett/mcp-context-sliding'

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