analyze_conversation
Extract insights, themes, and patterns from AI conversations to identify key discussion points and trends.
Instructions
Analyze an AI conversation to extract insights, themes, and patterns
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conversation_id | Yes | The conversation ID to analyze |
Implementation Reference
- src/tools/ai-conversations.ts:308-337 (handler)The main handler function that executes the analyze_conversation tool logic, parsing input, fetching conversation data, performing analysis using helper functions, and returning structured insights.export const analyzeConversation = requireAuth(async (args: any) => { const { conversation_id } = AnalyzeConversationSchema.parse(args) logger.info('Analyzing conversation', { conversation_id }) const conversation = await getConversationFromDatabase(conversation_id) if (!conversation) { throw new Error('Conversation not found') } const analysis = { conversation_flow: analyzeConversationFlow(conversation.messages), content_analysis: analyzeConversationContent(conversation.messages), ai_performance: analyzeAIPerformance(conversation.messages), topic_modeling: extractTopicsAndThemes(conversation.messages), action_items: extractActionItemsFromConversation(conversation.messages, conversation.metadata?.context), decisions_made: extractDecisions(conversation.messages), questions_raised: extractQuestions(conversation.messages), knowledge_gaps: identifyKnowledgeGaps(conversation.messages), follow_up_suggestions: generateFollowUpSuggestions(conversation.messages, conversation.metadata?.context) } return { conversation_id, analysis, summary: generateAnalysisSummary(analysis), recommendations: generateRecommendations(analysis, conversation.metadata?.context) } })
- src/tools/ai-conversations.ts:48-50 (schema)Zod schema used for input validation in the analyze_conversation handler.const AnalyzeConversationSchema = z.object({ conversation_id: z.string().uuid() })
- src/tools/ai-conversations.ts:292-306 (registration)MCPTool object defining the tool metadata, name, description, and input schema for listing in MCP protocol.export const analyzeConversationTool: MCPTool = { name: 'analyze_conversation', description: 'Analyze an AI conversation to extract insights, themes, and patterns', inputSchema: { type: 'object', properties: { conversation_id: { type: 'string', format: 'uuid', description: 'The conversation ID to analyze' } }, required: ['conversation_id'] } }
- src/tools/ai-conversations.ts:851-856 (registration)Export of handlers map that registers the analyzeConversation handler under the 'analyze_conversation' key, imported into main allHandlers.export const conversationHandlers = { save_conversation: saveConversation, get_conversations: getConversations, analyze_conversation: analyzeConversation, extract_action_items: extractActionItems, generate_conversation_summary: generateConversationSummary
- src/index.ts:143-155 (registration)Central registration in MCP server constructor where conversationHandlers (including analyze_conversation) is spread into the main allHandlers object used for tool execution.this.allHandlers = { ...projectHandlers, ...taskHandlers, ...documentHandlers, ...conversationHandlers, ...contextAggregationHandlers, ...workflowAutomationHandlers, ...intelligentSearchHandlers, ...analyticsInsightsHandlers, ...initiativeHandlers, ...promptToProjectTools.reduce((acc, tool) => ({ ...acc, [tool.name]: tool.handler }), {}), ...debugHandlers, }