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) }] };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/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 mentions 'recently activated' and implies a time-based filter, but doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, or what the output format looks like (e.g., list of themes). This leaves significant gaps for an agent to understand how to handle the tool.

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 directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity of memory-related tools and no annotations or output schema, the description is incomplete. It doesn't explain what 'themes and patterns' entail, how results are returned, or any behavioral constraints, leaving the agent with insufficient context 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?

The input schema has 100% description coverage, with the 'days' parameter well-documented. The description adds minimal value beyond the schema by implying a time-based filter ('recently activated'), but doesn't provide additional semantics like default behavior or usage context. This meets the baseline for high schema coverage.

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. However, it doesn't explicitly differentiate from sibling tools like 'get_memory_clusters' or 'get_memory_history', which might also retrieve memory-related data, so it misses full sibling distinction.

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 many sibling tools like 'get_memory_clusters' or 'search_memories_advanced', there's no indication of context, prerequisites, or exclusions for selecting this specific tool.

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