Skip to main content
Glama

activate_cluster

Activate a memory cluster to retrieve stored episodic, semantic, or procedural data for AI systems, enabling persistent memory and long-term continuity.

Instructions

Activate a memory cluster and get its associated memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYesUUID of the cluster to activate
contextNoContext description for this activation

Implementation Reference

  • Main handler implementation of activateCluster method in MemoryManager class. Updates cluster activation count and timestamp, records activation history in the database, and returns the cluster's associated memories via getClusterMemories.
    async activateCluster(clusterId, context = null) {
      try {
        const result = await this.db.transaction(async (tx) => {
          // Update cluster activation
          await tx
            .update(schema.memoryClusters)
            .set({
              activationCount: sql`${schema.memoryClusters.activationCount} + 1`,
              lastActivated: new Date()
            })
            .where(eq(schema.memoryClusters.id, clusterId));
    
          // Record activation history
          await tx.insert(schema.clusterActivationHistory).values({
            clusterId,
            activationContext: context,
            activationStrength: 1.0
          });
    
          return true;
        });
    
        // Return cluster with recent memories
        return await this.getClusterMemories(clusterId);
      } catch (error) {
        console.error('Error activating cluster:', error);
        throw error;
      }
    }
  • Tool schema definition for activate_cluster in memory-tools.js. Defines the input validation schema with cluster_id (required UUID) and context (optional string) parameters.
      name: "activate_cluster",
      description: "Activate a memory cluster and get its associated memories",
      inputSchema: {
        type: "object",
        properties: {
          cluster_id: {
            type: "string",
            description: "UUID of the cluster to activate"
          },
          context: {
            type: "string",
            description: "Context description for this activation",
            default: null
          }
        },
        required: ["cluster_id"]
      }
    },
  • mcp.js:569-574 (registration)
    MCP tool registration handler in mcp.js switch statement. Receives tool call arguments and invokes the MemoryManager.activateCluster method with cluster_id and context parameters.
    case "activate_cluster":
      const clusterMemories = await memoryManager.activateCluster(
        args.cluster_id,
        args.context || null
      );
      return { content: [{ type: "text", text: JSON.stringify(clusterMemories, null, 2) }] };
  • mcp.js:135-152 (registration)
    MCP tool schema registration in ListToolsRequestSchema handler. Defines the activate_cluster tool's metadata and input schema that's exposed to MCP clients.
      name: "activate_cluster",
      description: "Activate a memory cluster and get its associated memories",
      inputSchema: {
        type: "object",
        properties: {
          cluster_id: {
            type: "string",
            description: "UUID of the cluster to activate"
          },
          context: {
            type: "string",
            description: "Context description for this activation",
            default: null
          }
        },
        required: ["cluster_id"]
      }
    },

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