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'));

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