Skip to main content
Glama

memory_compile_context

Compile relevant memories into a token-budgeted, markdown-formatted system prompt with important and recent sections for LLM context.

Instructions

Compile memories into an LLM-ready system prompt (markdown formatted, token-budgeted, split into important and recent sections).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actorIdNoActor ID. Defaults to the current session actor.
maxTokensNoMaximum tokens for the compiled context. Default: 2000.
memoryTypesNoFilter by memory types

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries full responsibility. It mentions the output formatting and structure, suggesting a read-only aggregation operation. It does not explicitly state side effects, but the name and description imply no state changes, providing reasonable transparency.

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 a single, concise sentence that efficiently conveys the tool's purpose and output characteristics without redundancy. It is well-structured and easy to parse.

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 provides sufficient context for an agent to understand what the tool does and what it returns, given the sibling list. It lacks an explicit comparison to alternatives, but the purpose is clear enough for typical use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All three parameters have clear descriptions: actorId defaults to current session, maxTokens sets a limit with default, and memoryTypes filters by type. The schema fully covers parameter meaning and defaults, leaving no ambiguity.

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: compiling memories into an LLM-ready system prompt. It specifies the resource (memories), the action (compile), and the output format (markdown, token-budgeted, split into sections), distinguishing it from sibling memory tools that retrieve, summarize, or store.

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 implies usage for generating a compiled context prompt for LLM interactions, which differentiates it from sibling tools like retrieve or summarize. However, it does not explicitly state when to use this tool over alternatives, leaving some inference to the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.