Skip to main content
Glama

memory_prepare_compaction

Read-onlyIdempotent

Retrieves cold entries grouped by agent, providing token counts for summarization and subsequent memory compaction.

Instructions

Returns cold entries grouped by agent session — ready for YOU to summarize.

Read the returned entries, write your own digest with memory_write(memory_type='context'). Digests are read ONLY by agents: write them in compressed English (token-thrift) — facts, decisions, file paths; no prose. Code/paths/IDs stay verbatim. then run memory_compact() to archive the originals.

Workflow:

  1. Call memory_prepare_compaction() → get grouped cold entries

  2. Read and summarize them yourself

  3. Call memory_write(memory_type='context', title='Digest: ...', content='your summary')

  4. Call memory_compact() → archives cold entries, keeps your digest

Returns: str: Cold entries grouped by agent, with token counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the safe read-only nature is already communicated. The description adds value by detailing that output is a string with token counts and that the intended usage is to summarize before compacting, which gives the agent a clearer picture of expected behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is somewhat lengthy due to the workflow and style guidance, but it is well-organized and front-loaded with the primary purpose. The workflow list makes it scannable, and each sentence contributes useful information, so it earns a 4 rather than a lower score.

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 return type, the full workflow, and important context about how digest content should be written (compressed English, verbatim code/paths/IDs). With no parameters and safe annotations, this is sufficient for the agent to use the tool effectively.

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?

The tool has no parameters and the input schema is empty, so there are no parameter descriptions needed. The baseline for zero-parameter tools is 4, and the description does not attempt to explain any (non-existent) parameters.

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 explicitly states that the tool 'Returns cold entries grouped by agent session' and frames it as a preparation step for summarization and compaction. This distinguishes it from sibling tools like memory_compact, which performs the actual archival, by indicating this is the read step before writing a digest.

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?

It provides a numbered workflow: call memory_prepare_compaction, summarize, call memory_write for the digest, then call memory_compact. This makes it clear when to use this tool as the initiation of a compaction sequence, though it does not explicitly list scenarios where it should not be used.

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/swisspra/On_Board'

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