Skip to main content
Glama
QuixiAI

AGI MCP Server

by QuixiAI

get_cluster_insights

Analyze memory cluster data to extract detailed insights and performance metrics for AI system optimization.

Instructions

Get detailed analytics for a memory cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYesUUID of the cluster

Implementation Reference

  • Core handler function in MemoryManager class that executes the database query to retrieve detailed insights for a specific memory cluster, including stats like total memories, average importance, recent activity, and memory types.
    async getClusterInsights(clusterId) {
      try {
        const insights = await this.db
          .select({
            id: schema.memoryClusters.id,
            name: schema.memoryClusters.name,
            clusterType: schema.memoryClusters.clusterType,
            description: schema.memoryClusters.description,
            importanceScore: schema.memoryClusters.importanceScore,
            totalMemories: sql`COUNT(${schema.memoryClusterMembers.memoryId})`.as('total_memories'),
            avgImportance: sql`AVG(${schema.memories.importance})`.as('avg_importance'),
            lastMemoryAccess: sql`MAX(${schema.memories.lastAccessed})`.as('last_memory_access'),
            recentMemories: sql`COUNT(CASE WHEN ${schema.memories.createdAt} > CURRENT_TIMESTAMP - INTERVAL '7 days' THEN 1 END)`.as('recent_memories'),
            avgMembershipStrength: sql`AVG(${schema.memoryClusterMembers.membershipStrength})`.as('avg_membership_strength'),
            memoryTypes: sql`array_agg(DISTINCT ${schema.memories.type})`.as('memory_types')
          })
          .from(schema.memoryClusters)
          .leftJoin(
            schema.memoryClusterMembers,
            eq(schema.memoryClusters.id, schema.memoryClusterMembers.clusterId)
          )
          .leftJoin(
            schema.memories,
            and(
              eq(schema.memoryClusterMembers.memoryId, schema.memories.id),
              eq(schema.memories.status, 'active')
            )
          )
          .where(eq(schema.memoryClusters.id, clusterId))
          .groupBy(schema.memoryClusters.id)
          .limit(1);
    
        return insights[0] || null;
      } catch (error) {
        console.warn('Cluster insights query failed:', error.message);
        return null;
      }
    }
  • mcp.js:645-647 (registration)
    Dispatch handler in MCP server that maps the tool call to the MemoryManager.getClusterInsights method and formats the response.
    case "get_cluster_insights":
      const clusterInsights = await memoryManager.getClusterInsights(args.cluster_id);
      return { content: [{ type: "text", text: JSON.stringify(clusterInsights, null, 2) }] };
  • Tool registration entry in ListTools handler defining the name, description, and input schema (cluster_id required).
      name: "get_cluster_insights",
      description: "Get detailed analytics for a memory cluster",
      inputSchema: {
        type: "object",
        properties: {
          cluster_id: {
            type: "string",
            description: "UUID of the cluster"
          }
        },
        required: ["cluster_id"]
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It implies a read-only operation ('Get') but doesn't specify whether it requires authentication, has rate limits, returns structured data, or involves side effects. For a tool that presumably returns analytics data, this lack of behavioral context is a significant gap.

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 that front-loads the core purpose without unnecessary words. Every word earns its place: 'Get' (action), 'detailed analytics' (output type), 'for a memory cluster' (target). There's no redundancy or fluff.

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?

For a tool with no annotations, no output schema, and a single parameter, the description is incomplete. It doesn't explain what 'detailed analytics' includes (e.g., metrics, timestamps, visualizations), how results are structured, or error conditions. Given the complexity implied by 'analytics' and lack of structured fields, more context is needed for effective use.

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 single parameter 'cluster_id' documented as a UUID. The description adds no additional parameter semantics beyond what the schema provides—it doesn't clarify format examples, valid UUID ranges, or how to obtain cluster IDs. Given the high schema coverage, the baseline score of 3 is appropriate.

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 action ('Get detailed analytics') and target resource ('for a memory cluster'), making the purpose immediately understandable. It distinguishes from siblings like 'get_memory_clusters' (which likely lists clusters) and 'get_memory_health' (which might provide health metrics rather than analytics). However, it doesn't specify what 'detailed analytics' includes, leaving some ambiguity.

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 like 'get_memory_clusters' or 'get_memory_health'. It doesn't mention prerequisites (e.g., needing an existing cluster) or contextual cues (e.g., use when analyzing cluster performance). The agent must infer usage from the name and sibling tools 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/QuixiAI/agi-mcp-server'

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