Skip to main content
Glama

Compact context

context_compact

Summarize accumulated history into a dense context block, snapshot state, and re-hydrate tracked files to reset and continue with a compact ground truth.

Instructions

Summarize accumulated history into a dense block, snapshot the ledger, re-hydrate tracked files, and run Pre/PostCompact hooks. Returns the compacted context block to install as new ground truth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
preserveNoExtra preservation instructions, e.g. 'keep all exact error strings'.
sessionIdNo
transcriptNoRequired in passthrough mode: the full history to compact.
Behavior4/5

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

The description discloses multiple behavioral traits beyond a simple summarize: it snapshots the ledger, re-hydrates tracked files, and runs Pre/PostCompact hooks. Since no annotations exist, this is valuable. It also states the return value. However, it does not mention potential destructive effects or permission requirements.

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 a single dense sentence that front-loads the primary action and lists additional side effects. No wasted words; every clause adds information.

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?

The description covers the core operation, side effects, and return value, which is adequate given no output schema. However, it omits context for 'passthrough mode' referenced in the transcript parameter and does not clarify sessionId, leaving some gaps for a complex tool.

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 input schema describes two of three parameters (preserve and transcript) with clear descriptions, but sessionId is undocumented. The tool description adds no parameter explanations or usage examples, leaving ambiguity about sessionId and passthrough mode.

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 uses specific verbs (summarize, snapshot, re-hydrate, run) and identifies the resource (accumulated history, ledger, tracked files). It clearly distinguishes from sibling tools like context_trim and context_clear by describing the full compaction process.

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?

The description implies the tool is for compacting accumulated history but does not provide explicit guidance on when to use it versus alternatives like context_trim or context_clear. No exclusions or alternative names are mentioned.

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/Ink01101011/compaction-mcp'

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