Skip to main content
Glama

compress_observations

Compresses recent raw hook observations into structured typed summaries to reduce session-history token count before loading project memory; raw data is retained and only marked compressed.

Instructions

Compress recent raw hook observations into structured typed summaries (tool_failure, tool_success, file_edit, generic) using rule-based analysis. Reduces token count when injecting session history into context. Does not delete raw observations, only marks them as compressed. Call before get_state or at session start to ensure hook data is compact before loading project memory. Returns the count of compressed items and a human-readable summary of what was processed.

Input Schema

NameRequiredDescriptionDefault
limitNoMax number of raw observations to process. Default: 50.
sinceNoISO 8601 timestamp: only compress observations newer than this. Optional.
project_pathNoAbsolute path to the project root. Defaults to current working directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.20
  2. Removedv1.1.12
  3. Addedv1.0.7

TDQS

A4.9/5.0
Behavior5/5

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

As there are no annotations, the description must carry all behavioral context. It clearly states crucial constraints: it 'does not delete raw observations, only marks them as compressed,' and explains the functional benefit (reduces token count).

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 paragraph is highly dense with information, covering function, constraints, behavior, and workflow guidance efficiently in a single cohesive block.

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

Completeness5/5

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

The description is complete; it details the input parameters' purpose, the resulting state of the raw data (marked, not deleted), and the expected output format (count and human-readable summary).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the description isn't required to explain syntax, but it successfully frames the use of the parameters (like 'since') within the context of targeted data reduction.

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 purpose is stated explicitly: compressing raw hook observations into structured, typed summaries. It clearly distinguishes itself from other state management tools by focusing on data reduction.

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?

It provides explicit workflow instructions: the tool must be called 'before get_state or at session start' to ensure the data is compact before memory loading.

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