Skip to main content
Glama

session_compact_ledger

Compact outdated session ledger entries into AI-generated summaries to prevent storage bloat and maintain fast context loading. Archives historical records while preserving recent entries, with dry-run preview support.

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
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).
dry_runNoIf true, only preview what would be compacted without executing. Default: false.
Behavior4/5

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

With no annotations provided, the description carries full safety disclosure burden. It successfully reveals critical behavioral traits: uses Gemini for summarization, performs soft-delete (archives originals), preserves recent entries based on keep_recent parameter, and operates via a three-step process. Missing minor operational details like idempotency or reversibility.

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?

Excellent structure with value proposition front-loaded ('prevents the ledger from growing indefinitely'), followed by numbered mechanics, and ending with the dry_run usage tip. No redundant text; every sentence conveys distinct information about mechanism, safety, or usage.

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 tool's complexity (AI involvement, data mutation, 4 parameters) and lack of annotations/output schema, the description adequately covers the process flow and side effects (rollup insertion, archiving). Minor gap in not describing the return value or success indicators, though the dry_run behavior implies output preview capability.

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 100%, establishing a baseline of 3. The description references parameters narratively (threshold, dry_run, keep_recent behavior) but does not add semantic meaning beyond what the schema already provides, nor does it clarify parameter formats or constraints not covered in the schema.

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 'Auto-compact old session ledger entries by rolling them up into AI-generated summaries.' This provides a specific verb (compact/roll up), resource (session ledger entries), and mechanism (AI-generated summaries). It distinguishes from siblings like deep_storage_purge by emphasizing rollup/summarization rather than deletion.

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?

Provides clear usage guidance via 'Use dry_run=true to preview what would be compacted without executing' and explains the value proposition (prevents indefinite growth, keeps loading fast). However, it lacks explicit comparison to siblings like maintenance_vacuum or deep_storage_purge to clarify when compaction is preferred over purging.

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/BCBA'

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