Skip to main content
Glama

get_active_themes

Retrieve recently activated memory themes and patterns to maintain AI system continuity through thematic clustering and identity tracking.

Instructions

Get recently activated memory themes and patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days to look back

Implementation Reference

  • The getActiveThemes method that queries the active_themes database view and returns themes data
    async getActiveThemes(days = 7) {
      try {
        const themes = await this.db
          .select()
          .from(schema.activeThemes);
    
        return themes;
      } catch (error) {
        console.error('Error getting active themes:', error);
        throw error;
      }
    }
  • Database view definition for active_themes that aggregates cluster activation data over the past 7 days
    export const activeThemes = pgView("active_themes", {	theme: text(),
    	emotionalSignature: jsonb("emotional_signature"),
    	keywords: text(),
    	// You can use { mode: "bigint" } if numbers are exceeding js number limitations
    	recentActivations: bigint("recent_activations", { mode: "number" }),
    	associatedThemes: uuid("associated_themes"),
    }).as(sql`SELECT mc.name AS theme, mc.emotional_signature, mc.keywords, count(DISTINCT mch.id) AS recent_activations, array_agg(DISTINCT mch.co_activated_clusters) FILTER (WHERE mch.co_activated_clusters IS NOT NULL) AS associated_themes FROM memory_clusters mc JOIN cluster_activation_history mch ON mc.id = mch.cluster_id WHERE mch.activated_at > (CURRENT_TIMESTAMP - '7 days'::interval) GROUP BY mc.id, mc.name, mc.emotional_signature, mc.keywords ORDER BY (count(DISTINCT mch.id)) DESC`);
  • Tool schema definition defining the input parameters (days) for get_active_themes
      name: "get_active_themes",
      description: "Get recently activated memory themes and patterns",
      inputSchema: {
        type: "object",
        properties: {
          days: {
            type: "integer",
            description: "Number of days to look back",
            default: 7
          }
        }
      }
    },
  • mcp.js:206-218 (registration)
    MCP server registration of the get_active_themes tool with its input schema
    {
      name: "get_active_themes",
      description: "Get recently activated memory themes and patterns",
      inputSchema: {
        type: "object",
        properties: {
          days: {
            type: "integer",
            description: "Number of days to look back",
            default: 7
          }
        }
      }
  • mcp.js:597-599 (handler)
    MCP tool handler that calls memoryManager.getActiveThemes with the days parameter
    case "get_active_themes":
      const themes = await memoryManager.getActiveThemes(args.days || 7);
      return { content: [{ type: "text", text: JSON.stringify(themes, null, 2) }] };
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 implies a read operation but doesn't disclose behavioral traits such as permissions needed, rate limits, pagination, or what 'recently activated' entails beyond the parameter. This is inadequate for a tool with no annotation coverage.

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 zero waste. It's front-loaded and appropriately sized for the tool's complexity, earning full marks for 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 the lack of annotations and output schema, the description is incomplete. It doesn't explain return values, error handling, or behavioral context, making it insufficient for a tool in a complex memory management system with many siblings.

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 schema description coverage is 100%, with the parameter 'days' fully documented in the schema. The description adds no additional meaning beyond implying temporal filtering, so it meets the baseline of 3 without compensating or detracting.

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 verb ('Get') and resource ('recently activated memory themes and patterns'), making the purpose understandable. It doesn't explicitly distinguish from sibling tools like 'get_memory_history' or 'get_cluster_insights' which might also retrieve temporal or thematic data, so it misses the highest score.

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. With siblings like 'get_memory_history' and 'get_cluster_insights', there's no indication of context, prerequisites, or exclusions, leaving usage ambiguous.

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