Skip to main content
Glama

get_memory_history

Retrieve change history for a specific memory in the AGI MCP Server's persistent storage system to track modifications and maintain continuity.

Instructions

Get change history for a specific memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memory_idYesUUID of the memory

Implementation Reference

  • The actual implementation of getMemoryHistory method that queries the memoryChanges table for all changes associated with a given memory ID, ordered by changedAt in descending order (most recent first).
    async getMemoryHistory(memoryId) {
      try {
        const history = await this.db
          .select()
          .from(schema.memoryChanges)
          .where(eq(schema.memoryChanges.memoryId, memoryId))
          .orderBy(desc(schema.memoryChanges.changedAt));
    
        return history;
      } catch (error) {
        console.warn('Memory history query failed:', error.message);
        return [];
      }
    }
  • Tool schema definition for get_memory_history, specifying the input validation with memory_id as required parameter.
      name: "get_memory_history",
      description: "Get change history for a specific memory",
      inputSchema: {
        type: "object",
        properties: {
          memory_id: {
            type: "string",
            description: "UUID of the memory"
          }
        },
        required: ["memory_id"]
      }
    },
  • mcp.js:674-676 (registration)
    Handler registration in the switch statement that calls memoryManager.getMemoryHistory and returns the results as JSON.
    case "get_memory_history":
      const memoryHistory = await memoryManager.getMemoryHistory(args.memory_id);
      return { content: [{ type: "text", text: JSON.stringify(memoryHistory, null, 2) }] };
  • mcp.js:459-470 (registration)
    Tool registration in the MCP server's ListTools handler, exposing get_memory_history to clients.
    name: "get_memory_history",
    description: "Get change history for a specific memory",
    inputSchema: {
      type: "object",
      properties: {
        memory_id: {
          type: "string",
          description: "UUID of the memory"
        }
      },
      required: ["memory_id"]
    }
  • Database schema for the memoryChanges table that stores change history records with changeId, memoryId, changedAt, changeType, oldValue, and newValue fields.
    export const memoryChanges = pgTable("memory_changes", {
    	changeId: uuid("change_id").defaultRandom().primaryKey().notNull(),
    	memoryId: uuid("memory_id"),
    	changedAt: timestamp("changed_at", { withTimezone: true, mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
    	changeType: text("change_type").notNull(),
    	oldValue: jsonb("old_value"),
    	newValue: jsonb("new_value"),
    }, (table) => [
    	foreignKey({
    			columns: [table.memoryId],
    			foreignColumns: [memories.id],
    			name: "memory_changes_memory_id_fkey"
    		}),
    ]);
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 'change history', implying a read-only operation that returns historical data, but doesn't specify what 'change history' includes (e.g., timestamps, types of changes, user information), whether it's paginated, requires authentication, has rate limits, or returns errors for invalid IDs. 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, efficient sentence: 'Get change history for a specific memory'. It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple tool. Every part of the sentence earns its place by specifying the action and target.

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 tool's complexity (simple retrieval with one parameter) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'change history' entails (e.g., structured data like logs or raw text), potential return values, error conditions, or behavioral aspects like performance. For a tool with no structured output or annotations, more context is needed to be fully helpful.

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 the single parameter 'memory_id' documented as 'UUID of the memory'. The description doesn't add any meaning beyond this (e.g., format examples, where to find the ID, or validation rules). With high schema coverage, the baseline is 3, as the schema does the heavy lifting and the description doesn't compensate with extra details.

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 as 'Get change history for a specific memory', which includes a specific verb ('Get') and resource ('change history for a specific memory'). It distinguishes from siblings like 'get_memory' (which retrieves the memory itself) and 'get_memory_relationships' (which focuses on connections), but doesn't explicitly differentiate from all siblings (e.g., 'get_memory_health' might also involve historical data). The description is clear but lacks explicit sibling differentiation.

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 prerequisites (e.g., needing a valid memory_id), exclusions (e.g., not for real-time updates), or comparisons to siblings like 'get_memory' (for current state) or 'search_memories_advanced' (for broader queries). Usage is implied by the name and purpose, but no explicit context is given.

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