Skip to main content
Glama

Cognitive Context Compactor

kilo_compact_context
Read-onlyIdempotent

Reduce verbose logs, test dumps, and noisy output by 40-70% while preserving architectural invariants for AI coding agents.

Instructions

Compacts verbose logs, test dumps, and noisy output by 40-70% while preserving architectural invariants.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNomarkdown
contentYesVerbose content to compact
sessionIdNoActive session ID to register context compaction
targetReductionNoCompaction aggressiveness
preserveInvariantsNoKey invariant rules or phrases to lock

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower. The description adds meaningful behavioral traits beyond annotations: the 40-70% reduction magnitude and invariant preservation. It omits session registration side effects and the mechanics of preserveInvariants/targetReduction, keeping it short of a 5.

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?

A single front-loaded sentence with the verb first and zero wasted words. Efficient and immediately scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with no output schema, the description carries the burden of describing the return value and the role of sessionId, format, and targetReduction levels. None of this is addressed, so an agent cannot know what the tool returns or how session registration behaves.

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 80%, so the baseline is 3. The description alludes to invariants and reduction (loosely mapping to preserveInvariants and targetReduction) but adds no syntax or semantics for format, sessionId, or how the preservation list is applied. It does not meaningfully compensate beyond the schema.

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 gives a specific verb ('Compacts') and resource (verbose logs, test dumps, noisy output) and even quantifies the effect (40-70%). It is clearly the only compaction tool among siblings like kilo_remember_fact and kilo_grep_code, though it does not explicitly name a sibling it differs from.

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?

Usage is implied by naming the input types (verbose logs, test dumps, noisy output), so an agent can infer when it applies. However, there is no explicit when-to-use vs alternatives guidance and no exclusions or prerequisites (e.g., session requirements).

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