Skip to main content
Glama

get_working_memories

Retrieve active working memories from AGI MCP Server to maintain continuity in AI conversations, with optional inclusion of expired memories for comprehensive context.

Instructions

Retrieve current working memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_expiredNoInclude expired working memories

Implementation Reference

  • mcp.js:664-668 (handler)
    MCP server handler for the 'get_working_memories' tool. Extracts the 'include_expired' parameter from tool arguments and delegates to MemoryManager.getWorkingMemories, then formats the result as MCP content.
    case "get_working_memories": const workingMemories = await memoryManager.getWorkingMemories( args.include_expired || false ); return { content: [{ type: "text", text: JSON.stringify(workingMemories, null, 2) }] };
  • Core implementation of getWorkingMemories in MemoryManager class. Queries the workingMemory database table, optionally filtering out expired entries based on the expiry timestamp, and returns results ordered by creation time.
    async getWorkingMemories(includeExpired = false) { try { let query = this.db.select().from(schema.workingMemory); if (!includeExpired) { query = query.where( or( isNull(schema.workingMemory.expiry), gt(schema.workingMemory.expiry, new Date()) ) ); } const results = await query.orderBy(desc(schema.workingMemory.createdAt)); return results; } catch (error) { console.error('Error getting working memories:', error); throw error; }
  • Tool schema definition provided in the MCP listTools response, specifying the input schema with optional 'include_expired' boolean parameter.
    { name: "get_working_memories", description: "Retrieve current working memories", inputSchema: { type: "object", properties: { include_expired: { type: "boolean", description: "Include expired working memories", default: false } } }

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/QuixiAI/agi-mcp-server'

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