Skip to main content
Glama

get_episodic_memory

Retrieve user episodic memories to access past events and experiences, enabling personalized AI interactions through historical context recall.

Instructions

Retrieve episodic memories for a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of memories to return
userIdYesUser identifier

Implementation Reference

  • Tool handler case for 'get_episodic_memory' that validates inputs, retrieves memories from MemoryStore, and returns them as JSON.
    case "get_episodic_memory": {
      const { userId, limit } = request.params.arguments as any;
      
      // Validate inputs
      ValidationUtils.validateUserId(userId);
      ValidationUtils.validateLimit(limit);
      
      const memories = memoryStore.getEpisodicMemory(userId, limit);
      return {
        content: [{
          type: "text",
          text: JSON.stringify(memories, null, 2)
        }]
      };
    }
  • Registration of the 'get_episodic_memory' tool in the listTools handler, including name, description, and input schema.
    {
      name: "get_episodic_memory",
      description: "Retrieve episodic memories for a user",
      inputSchema: {
        type: "object",
        properties: {
          userId: {
            type: "string",
            description: "User identifier"
          },
          limit: {
            type: "number",
            description: "Maximum number of memories to return"
          }
        },
        required: ["userId"]
      }
    },
  • Input schema definition for the 'get_episodic_memory' tool.
    inputSchema: {
      type: "object",
      properties: {
        userId: {
          type: "string",
          description: "User identifier"
        },
        limit: {
          type: "number",
          description: "Maximum number of memories to return"
        }
      },
      required: ["userId"]
    }
  • Core implementation in MemoryStore that filters episodic memories by userId, sorts by timestamp descending, and applies limit if provided.
    getEpisodicMemory(userId: string, limit?: number): EpisodicMemory[] {
      const memories = Array.from(this.episodicMemory.values())
        .filter(memory => memory.userId === userId)
        .sort((a, b) => b.timestamp - a.timestamp);
      
      return limit ? memories.slice(0, limit) : memories;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('retrieve') without detailing aspects like authentication needs, rate limits, error handling, or what the return format looks like (e.g., list of memories with timestamps). This leaves significant gaps in understanding how the tool behaves in practice.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could be more front-loaded with key details if expanded.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what episodic memories are, how they're structured, or what the return values include, which is crucial for a tool with sibling memory types and no structured output documentation. This leaves the agent under-informed about the tool's context and results.

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%, with clear descriptions for both parameters ('limit' and 'userId') in the input schema. The description adds no additional meaning beyond this, such as explaining the format of 'userId' or typical 'limit' values. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('retrieve') and resource ('episodic memories for a user'), which provides a basic understanding of the tool's function. However, it lacks specificity about what episodic memories are or how they differ from other memory types, and doesn't distinguish this tool from sibling tools like 'get_long_term_memory' or 'get_short_term_memory', making the purpose somewhat vague.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'search_episodic_memory' for filtered retrieval or differentiate from other memory types, leaving the agent with no context for tool selection beyond the basic purpose.

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/cbuntingde/memory-mcp-server'

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