generate_conversation_summary
Create summaries from conversations, including brief overviews, detailed recaps, action items, or decision records for project management.
Instructions
Generate different types of summaries from a conversation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conversation_id | Yes | The conversation ID to summarize | |
| summary_type | No | Type of summary to generate | brief |
Implementation Reference
- src/tools/ai-conversations.ts:439-484 (handler)The primary handler function for the 'generate_conversation_summary' tool. It validates input using Zod schema, fetches the conversation from the database, generates a summary based on the specified type using specialized helper functions, computes metadata, and returns the summary with statistics.export const generateConversationSummary = requireAuth(async (args: any) => { const { conversation_id, summary_type } = GenerateConversationSummarySchema.parse(args) logger.info('Generating conversation summary', { conversation_id, summary_type }) const conversation = await getConversationFromDatabase(conversation_id) if (!conversation) { throw new Error('Conversation not found') } let summary: string switch (summary_type) { case 'brief': summary = generateBriefSummary(conversation.messages) break case 'detailed': summary = generateDetailedSummary(conversation.messages, conversation.metadata?.context) break case 'action_items': summary = generateActionItemsSummary(conversation.messages) break case 'decisions': summary = generateDecisionsSummary(conversation.messages) break default: summary = generateBriefSummary(conversation.messages) } const metadata = { conversation_id, summary_type, generated_at: new Date().toISOString(), message_count: conversation.messages.length, conversation_duration: calculateConversationDuration(conversation.messages), key_participants: extractParticipants(conversation.messages) } return { summary, metadata, word_count: summary.split(' ').length, reading_time: Math.ceil(summary.split(' ').length / 200) // 200 words per minute } })
- src/tools/ai-conversations.ts:57-60 (schema)Zod schema defining the input parameters for the tool: required conversation_id (UUID) and optional summary_type (enum with default 'brief'). Used for input validation in the handler.const GenerateConversationSummarySchema = z.object({ conversation_id: z.string().uuid(), summary_type: z.enum(['brief', 'detailed', 'action_items', 'decisions']).default('brief') })
- src/tools/ai-conversations.ts:417-437 (registration)MCPTool registration object defining the tool's name, description, and input schema (JSON Schema format mirroring the Zod schema). This is likely used to register the tool with the MCP system.export const generateConversationSummaryTool: MCPTool = { name: 'generate_conversation_summary', description: 'Generate different types of summaries from a conversation', inputSchema: { type: 'object', properties: { conversation_id: { type: 'string', format: 'uuid', description: 'The conversation ID to summarize' }, summary_type: { type: 'string', enum: ['brief', 'detailed', 'action_items', 'decisions'], default: 'brief', description: 'Type of summary to generate' } }, required: ['conversation_id'] } }
- src/tools/ai-conversations.ts:851-857 (registration)Export object mapping tool names (snake_case) to their handler functions, serving as a registry for all conversation-related tools including generate_conversation_summary.export const conversationHandlers = { save_conversation: saveConversation, get_conversations: getConversations, analyze_conversation: analyzeConversation, extract_action_items: extractActionItems, generate_conversation_summary: generateConversationSummary }