Skip to main content
Glama

get_memory_context

Retrieve creation and update details for specific long-term memories to understand their context and evolution over time.

Instructions

Get the creation and update context of a specific long-term memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the memory
conversation_idNoConversation ID that owns this memory

Implementation Reference

  • The main handler function for the 'get_memory_context' tool. It retrieves the specified long-term memory using memoryManager.findMemoryByName and returns detailed context information including creation/update contexts and trigger.
    handler: async (args) => {
      try {
        const memory = memoryManager.findMemoryByName(args.name);
    
        if (!memory) {
          return {
            success: false,
            message: `Memory "${args.name}" not found`
          };
        }
    
        return {
          success: true,
          name: memory.name,
          createdAt: memory.createdAt.toISOString(),
          updatedAt: memory.updatedAt?.toISOString(),
          createdContext: memory.createdContext || null,
          updatedContext: memory.updatedContext || null,
          formattedContext: memoryManager.formatMemoryContext(memory),
          trigger: memory.trigger
        };
      } catch (error) {
        return {
          success: false,
          error: error.message
        };
      }
    }
  • Zod input schema for the 'get_memory_context' tool, requiring the memory 'name' and optionally 'conversation_id'.
    inputSchema: z.object({
      name: z.string().describe('Name of the memory'),
      conversation_id: z.string().optional().describe('Conversation ID that owns this memory')
    }),
  • src/index.js:156-158 (registration)
    Registration of the long-term tools, including 'get_memory_context', into the MCP server's tool registry during server initialization.
    // 注册所有长期记忆工具
    const longTermTools = createLongTermTools(defaultLongTermManager, defaultStorageManager);
    longTermTools.forEach(tool => registerTool(tool, 'long-term'));
  • src/index.js:290-295 (registration)
    Dynamic recreation and invocation of long-term tools (including 'get_memory_context') during tool call handling, using conversation-specific managers.
    } else if (toolScope === 'long-term' || toolName.includes('long_term')) {
      manager = await getLongTermManager(conversationId);
      storage = getStorageManager(conversationId);
      const tools = createLongTermTools(manager, storage);
      const tool = tools.find(t => t.name === toolName);
      result = await withTimeout(tool.handler(validatedArgs), timeout, `Tool ${toolName} timeout`);
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 states the tool retrieves context (creation and update details), implying a read-only operation, but doesn't disclose critical behavioral traits such as authentication requirements, rate limits, error conditions, or what 'context' entails (e.g., timestamps, metadata). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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, well-structured sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action ('Get') and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information efficiently.

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 complexity of memory management tools and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'context' includes (e.g., timestamps, user info), how results are formatted, or potential errors. For a tool in a rich sibling set with no structured behavioral data, more detail is needed to ensure the agent can use it correctly.

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, with clear documentation for both parameters ('name' and 'conversation_id'). The description doesn't add any additional meaning beyond the schema, such as explaining parameter interactions or constraints. According to the rules, with high schema coverage (>80%), the baseline is 3 even without extra param info in the description, which fits here.

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

Purpose4/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: 'Get the creation and update context of a specific long-term memory.' It specifies the verb ('Get') and resource ('creation and update context of a specific long-term memory'), which is clear and actionable. However, it doesn't explicitly differentiate from sibling tools like 'get_memory_stats' or 'list_long_term_memories', which could provide overlapping or related information, so it doesn't reach a perfect score.

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 'list_long_term_memories' for browsing memories or 'search_long_term_memories' for finding memories by criteria, nor does it specify prerequisites or exclusions. This lack of context leaves the agent to infer usage, which is insufficient for effective tool selection.

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

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