Skip to main content
Glama

compress_context

Read-onlyIdempotent

Rank, deduplicate, and budget supplied context to retain critical items, reducing noisy input before AI processing.

Instructions

Rank, deduplicate, and budget supplied context while retaining critical items. Use for noisy context; do not expect semantic summarization or instruction promotion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
contextYes
maxTokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
droppedIdsYes
diagnosticsYes
afterEstimatedYes
budgetExceededYes
beforeEstimatedYes
duplicatesRemovedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/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, closed-world), so the description's real contribution is the algorithmic boundary — it clarifies this is mechanical ranking/budgeting, not summarization or instruction rewriting. That is meaningful added context, though it says nothing about failure modes, truncation behavior, or how the budget interacts with critical items.

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?

Two sentences, no filler. The positive capability is front-loaded and the negative expectation is second, which is exactly the right ordering for an agent scanning for fit.

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?

An output schema exists, so return values need no explanation, and the description covers purpose, trigger, and limits. The gap is parameter-level detail for a 0%-coverage schema, especially the undocumented query parameter that determines ranking relevance.

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 description coverage is 0% across three parameters, but the description maps loosely onto them: 'rank' implies the relevance-driving query, 'budget' implies maxTokens, and 'retaining critical items' implies the critical flag. It adds no format, default, or constraint detail, so the compensation is partial at best.

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 uses three specific verbs (rank, deduplicate, budget) on a named resource (supplied context) and states the retention goal ('while retaining critical items'). This is far more precise than the prompt-oriented siblings, though it never explicitly names an alternative to differentiate itself from them.

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?

'Use for noisy context' gives an explicit triggering condition, and 'do not expect semantic summarization or instruction promotion' is a clear negative scoping statement that prevents misuse. It lacks routing guidance naming a sibling alternative, so it falls short of a 5.

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