Skip to main content
Glama

get_frequent_conversation

Retrieve the most frequently mentioned conversation ID from stored memories to identify recurring discussion topics.

Instructions

Get the most frequently mentioned conversation ID in memories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_frequent_conversation': defines the tool with empty input schema and handler that calls ShortTermMemoryManager.getMostFrequentConversation() to retrieve and return the most frequent conversation ID.
    {
      name: 'get_frequent_conversation',
      description: 'Get the most frequently mentioned conversation ID in memories.',
      inputSchema: z.object({}),
      handler: async (args) => {
        try {
          const mostFrequent = memoryManager.getMostFrequentConversation();
    
          return {
            conversation_id: mostFrequent,
            message: mostFrequent 
              ? `Most frequent conversation: ${mostFrequent}`
              : 'No memories found'
          };
        } catch (error) {
          return {
            error: error.message
          };
        }
      }
    }
  • Core implementation in ShortTermMemoryManager: counts occurrences of each conversation_id across all memories and returns the ID with the highest count (or null if no memories).
    getMostFrequentConversation() {
      if (this.memories.length === 0) return null;
    
      const counts = {};
      for (const mem of this.memories) {
        counts[mem.conversation_id] = (counts[mem.conversation_id] || 0) + 1;
      }
    
      let maxCount = 0;
      let mostFrequent = null;
      for (const [id, count] of Object.entries(counts)) {
        if (count > maxCount) {
          maxCount = count;
          mostFrequent = id;
        }
      }
    
      return mostFrequent;
    }
  • src/index.js:152-154 (registration)
    Registers all short-term tools (including 'get_frequent_conversation') from createShortTermTools into the global toolRegistry with 'short-term' scope for the default conversation.
    // 注册所有短期记忆工具
    const shortTermTools = createShortTermTools(defaultShortTermManager, defaultStorageManager);
    shortTermTools.forEach(tool => registerTool(tool, 'short-term'));
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 what the tool does but lacks critical details: it doesn't specify if this is a read-only operation (likely, but not confirmed), how it determines frequency (e.g., based on memory content or metadata), what happens if no conversations exist (e.g., returns null or error), or any rate limits. The description is minimal and leaves behavioral traits ambiguous.

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 with no wasted words. It is appropriately sized for a simple tool and front-loaded with the core functionality. 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 query) but lack of annotations and output schema, the description is incomplete. It doesn't explain what the return value is (e.g., a single ID, a list with counts, or an error message), how frequency is calculated, or any dependencies on memory state. For a tool with no structured output documentation, the description should provide more context about the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (though empty). The description doesn't need to add parameter semantics, so it meets the baseline of 4 for zero-parameter tools. No additional parameter context is required or provided.

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: 'Get the most frequently mentioned conversation ID in memories.' It specifies the verb ('Get') and resource ('conversation ID'), and distinguishes it from siblings by focusing on frequency analysis rather than listing, searching, or managing memories. However, it doesn't explicitly differentiate from all siblings (e.g., 'analyze_memory_patterns' might overlap in analysis).

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 existing memories), exclusions (e.g., when no conversations exist), or comparisons to siblings like 'get_memory_stats' or 'analyze_memory_patterns'. Usage is implied only by the purpose statement.

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/win10ogod/memory-mcp-server'

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