Skip to main content
Glama

get_working_memories

Retrieve current working memories from the AGI MCP Server to access active AI system data for continuity and context maintenance.

Instructions

Retrieve current working memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_expiredNoInclude expired working memories

Implementation Reference

  • mcp.js:664-668 (handler)
    MCP tool handler that processes get_working_memories requests, extracts include_expired argument and calls MemoryManager.getWorkingMemories(), returning JSON-serialized results
    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 method that queries the workingMemory table, optionally filters expired memories, and returns results ordered by createdAt descending
    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;
      }
    }
  • mcp.js:437-448 (registration)
    Tool registration in ListToolsRequestSchema handler defining get_working_memories with name, description, and inputSchema containing 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
        }
      }
    }
  • Schema definition for get_working_memories tool exported from memory-tools module, defining input schema with include_expired boolean property
    name: "get_working_memories",
    description: "Retrieve current working memories",
    inputSchema: {
      type: "object",
      properties: {
        include_expired: {
          type: "boolean",
          description: "Include expired working memories",
          default: false
        }
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It implies a read operation ('retrieve') but doesn't disclose behavioral traits like permissions needed, rate limits, pagination, or what 'current' means operationally. This leaves gaps in understanding how the tool behaves beyond basic retrieval.

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 wasted words. It's front-loaded with the core action, though it could be more specific to improve clarity without losing conciseness.

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 no annotations, no output schema, and a vague description, this is incomplete for a retrieval tool among many siblings. The agent lacks critical context on what 'current' means, the return format, or how this differs from other memory tools, making it hard to use effectively.

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%, so the schema fully documents the single parameter 'include_expired'. The description adds no parameter semantics beyond what's in the schema, meeting the baseline of 3 for high coverage without extra value.

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 'Retrieve current working memories' states a clear verb ('retrieve') and resource ('working memories'), but it's vague about scope—'current' is ambiguous (active? recent?). It doesn't distinguish from siblings like 'get_memory', 'search_memories_advanced', or 'get_memory_history', leaving the agent unsure when to choose this tool over alternatives.

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 siblings. With many similar tools (e.g., 'get_memory', 'search_memories_advanced'), the description lacks context, prerequisites, or exclusions, forcing the agent to guess based on names alone.

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

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