Skip to main content
Glama

compress_observations

Compress raw hook observations into typed summaries to reduce token count in session history. Marks observations as compressed without deletion.

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

TableJSON 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.
Behavior5/5

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

With no annotations, the description fully discloses behavior: 'Does not delete raw observations — only marks them as compressed.' It also mentions it uses rule-based analysis, providing a complete picture of the tool's operation and side effects.

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 concise and well-structured, starting with the main purpose followed by key details. Every sentence adds value without redundancy.

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?

Even without an output schema, the description states the return value (count and summary). It covers when to use, what it transforms, side effects, and supported summary types, making it complete for the tool's complexity.

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% and the description does not add additional meaning to parameters beyond what the schema already provides. The description does not elaborate on parameter usage beyond the schema's descriptions and defaults.

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 clearly states the action 'Compress recent raw hook observations into structured typed summaries' and lists the summary types. It leaves no ambiguity about what the tool does.

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?

Explicitly says 'Call before get_state or at session start' and explains the benefit 'reduces token count when injecting session history'. This gives clear when-to-use guidance and differentiates from sibling tools like get_state.

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/Fmarzochi/EGC'

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