Skip to main content
Glama

session_compact_ledger

Auto-compact old session ledger entries by rolling them up into AI-generated summaries to prevent indefinite growth and keep deep context loading fast.

Instructions

Auto-compact old session ledger entries by rolling them up into AI-generated summaries. This prevents the ledger from growing indefinitely and keeps deep context loading fast.

How it works:

  1. Finds projects with more entries than the threshold

  2. Summarizes old entries using Gemini (keeps recent entries intact)

  3. Inserts a rollup entry and archives the originals (soft-delete)

Use dry_run=true to preview what would be compacted without executing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNoIf true, only preview what would be compacted without executing. Default: false.
projectNoOptional: compact a specific project. If omitted, auto-detects all candidates.
thresholdNoMinimum entries before compaction triggers (default: 50).
keep_recentNoNumber of recent entries to keep intact (default: 10).
Behavior4/5

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

No annotations are provided, so the description fully discloses behavior: it uses Gemini for summarization, archives originals with soft-delete, and keeps recent entries intact. The step-by-step explanation and mention of dry_run preview add transparency. However, it does not cover failure modes or authorization requirements.

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: a single-sentence overview, a clear bulleted list of how it works, and a practical tip. Every sentence adds value with no redundancy.

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?

Given the lack of output schema, the description does not specify the return format, which would be helpful for a summarization tool. However, it adequately covers behavior, parameters, and a preview option, making it fairly complete for selecting and invoking the tool.

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%, so the baseline is 3. The description does not elaborate on parameter details beyond mentioning dry_run in the usage note. The schema already describes each parameter, and the description adds minimal additional meaning.

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 tool's purpose: 'auto-compact old session ledger entries by rolling them up into AI-generated summaries.' It uses specific verbs ('compact', 'roll up') and identifies the resource ('old session ledger entries'), distinguishing it from siblings like session_save_ledger or session_backfill_links.

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?

The description provides a clear usage hint: 'Use dry_run=true to preview without executing,' which guides the agent on when to use preview mode. While it does not explicitly state when not to use the tool or compare to alternatives, the steps and context imply it is for maintenance to prevent ledger growth.

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/dcostenco/prism-coder'

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