Skip to main content
Glama

summarize_messages

Compress chat message history using AI summarization to manage conversation context within token limits while preserving recent messages and system instructions.

Instructions

Compress chat message history using AI-powered summarization strategy. Creates concise summaries of older messages while preserving system messages and recent context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of chat messages to compress
maxModelTokensNoModel's maximum token context window
thresholdPercentNoPercentage threshold to trigger compression (0-1)
minRecentMessagesNoMinimum recent messages to always preserve
openaiApiKeyNoOpenAI API key (can also be set via OPENAI_API_KEY environment variable)
openaiModelNoOpenAI model to use for summarizationgpt-4o-mini
customPromptNoCustom prompt for summarization (optional)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the tool's strategy ('AI-powered summarization'), what gets preserved ('system messages and recent context'), and what gets compressed ('older messages'), but doesn't mention rate limits, authentication requirements (though API key parameter hints at this), or error conditions.

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 perfectly concise with two sentences that each earn their place: the first states the core functionality, the second explains the preservation strategy. No wasted words, well-structured, and front-loaded with the essential purpose.

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?

For a complex tool with 7 parameters and no output schema, the description provides good context about the summarization approach and preservation logic. However, it doesn't explain what the output looks like (summary format) or potential limitations, leaving some gaps in completeness despite the strong schema coverage.

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?

The schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter documentation.

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 with specific verbs ('compress', 'creates concise summaries') and resources ('chat message history'), and distinguishes it from the sibling tool 'trim_messages' by specifying it uses 'AI-powered summarization strategy' rather than simple trimming.

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 clear context for when to use this tool ('compress chat message history', 'creates concise summaries of older messages'), but doesn't explicitly state when NOT to use it or mention the sibling tool 'trim_messages' as an alternative for different compression needs.

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/agentailor/slimcontext-mcp-server'

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