Skip to main content
Glama

consolidate_user

Merge user working memories into compact long-term summaries to retain essential context and streamline memory storage.

Instructions

Consolidate user-scoped working memories into long-term summaries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUser identifier
batchNoNumber of memories to consolidate (default 50)
keepNoMost recent N to leave untouched (default 20)
dryRunNoPreview without writing (default false)

Implementation Reference

  • src/index.ts:171-183 (registration)
    Tool registration for 'consolidate_user' within the ListToolsRequestSchema handler. Defines name, description, and inputSchema (userId, batch, keep, dryRun).
      name: 'consolidate_user',
      description: 'Consolidate user-scoped working memories into long-term summaries.',
      inputSchema: {
        type: 'object',
        properties: {
          userId:     { type: 'string', description: 'User identifier' },
          batch:      { type: 'number', description: 'Number of memories to consolidate (default 50)' },
          keep:       { type: 'number', description: 'Most recent N to leave untouched (default 20)' },
          dryRun:     { type: 'boolean', description: 'Preview without writing (default false)' },
        },
        required: ['userId'],
      },
    },
  • Handler for 'consolidate_user' tool. Calls memory.consolidateUser() with userId, batch, keep, and dryRun options, then returns the result as JSON.
    case 'consolidate_user': {
      const result = await memory.consolidateUser(args.userId as string, {
        batch:  args.batch  as number | undefined,
        keep:   args.keep   as number | undefined,
        dryRun: args.dryRun as boolean | undefined,
      });
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Compiled registration of 'consolidate_user' tool name.
    name: 'consolidate_user',
  • Compiled handler for 'consolidate_user' tool calling memory.consolidateUser().
    case 'consolidate_user': {
        const result = await memory.consolidateUser(args.userId, {
            batch: args.batch,
            keep: args.keep,
            dryRun: args.dryRun,
        });
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
Behavior3/5

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

Without annotations, the description indicates a write operation that transforms memories, but it does not clarify whether original memories are deleted or preserved, what permissions are needed, or the effect of the 'dryRun' parameter on actual execution.

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 a single, efficient sentence with no waste. It could be slightly more informative without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the basic purpose but lacks details on behavioral implications, default actions, and outcomes. For a tool with no output schema and no annotations, more context would be beneficial.

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 input schema has 100% description coverage, meaning the schema already explains all parameters adequately. The description adds no additional information beyond 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 action (consolidate) and resource (user-scoped working memories) and specifies the outcome (long-term summaries). It effectively distinguishes from sibling tools like 'consolidate' which may not be user-scoped.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'forget_user' or 'recall'. There is no mention of prerequisites, exclusions, or typical use cases.

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/Cartisien/engram-mcp'

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