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
        }
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.7/5.0
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. It states 'retrieve' implying a read-only operation, but doesn't disclose behavioral traits such as permissions needed, rate limits, pagination, or what 'current' means in practice (e.g., time-based or state-based). This leaves gaps for safe and effective use.

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, efficient sentence with no wasted words. It's front-loaded with the core purpose, making it easy to scan and understand quickly. Every word earns its place, adhering to best practices for concise tool descriptions.

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 for a retrieval tool. It doesn't explain what 'working memories' are, what data is returned, or how 'current' is defined, which could lead to misuse. For a tool in a memory system with many siblings, more context is needed to ensure proper selection and invocation.

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 the parameter 'include_expired' fully documented in the schema. The description doesn't add any meaning beyond the schema, as it doesn't mention parameters at all. With high schema coverage, the baseline score of 3 is appropriate since the schema handles the parameter documentation adequately.

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' clearly states the action (retrieve) and target resource (working memories), but it's somewhat vague about what constitutes 'current' versus other states. It doesn't differentiate from siblings like get_memory, get_memory_history, or search_memories_advanced, which might retrieve similar data with different filters or scopes.

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. With many sibling tools like get_memory (singular), get_memory_history, and search_memories_advanced, the description lacks context on whether this is for bulk retrieval, real-time data, or specific use cases, leaving the agent to guess based on the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.