Skip to main content
Glama
jakedx6
by jakedx6

extract_action_items

Extract actionable items from conversations and optionally create tasks automatically to track follow-ups and responsibilities.

Instructions

Extract actionable items from a conversation and optionally create tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conversation_idYesThe conversation ID to extract action items from
auto_create_tasksNoWhether to automatically create tasks for action items

Implementation Reference

  • The main handler function for the 'extract_action_items' tool. Parses input arguments using Zod schema, fetches the conversation from database, extracts action items using helper function, optionally auto-creates tasks via Supabase, and returns structured results with summary statistics.
    export const extractActionItems = requireAuth(async (args: any) => { const { conversation_id, auto_create_tasks } = ExtractActionItemsSchema.parse(args) logger.info('Extracting action items', { conversation_id, auto_create_tasks }) const conversation = await getConversationFromDatabase(conversation_id) if (!conversation) { throw new Error('Conversation not found') } const actionItems = extractActionItemsFromConversation( conversation.messages, conversation.metadata?.context ) let createdTasks = [] if (auto_create_tasks && actionItems.length > 0) { // Create tasks for each action item for (const item of actionItems) { try { const task = await supabaseService.createTask({ project_id: conversation.project_id, initiative_id: null, title: item.title, description: `${item.description}\n\nExtracted from conversation: ${conversation.title}\n\n[Source: AI Conversation ${conversation.id}, Confidence: ${item.confidence}]`, priority: item.priority || 'medium', status: 'todo', due_date: null, assignee_id: null }) createdTasks.push(task) } catch (error) { logger.error('Failed to create task from action item', { error, item }) } } } return { conversation_id, action_items: actionItems, created_tasks: createdTasks, summary: { total_items: actionItems.length, high_priority: actionItems.filter(item => item.priority === 'high').length, tasks_created: createdTasks.length } } })
  • Zod validation schema for tool inputs: requires conversation_id (UUID), optional auto_create_tasks (boolean, defaults to false). Used in the handler for input parsing.
    const ExtractActionItemsSchema = z.object({ conversation_id: z.string().uuid(), auto_create_tasks: z.boolean().default(false) })
  • MCPTool registration object defining the 'extract_action_items' tool with name, description, and JSON inputSchema. Exported in conversationTools and conversationHandlers for tool registry.
    export const extractActionItemsTool: MCPTool = { name: 'extract_action_items', description: 'Extract actionable items from a conversation and optionally create tasks', inputSchema: { type: 'object', properties: { conversation_id: { type: 'string', format: 'uuid', description: 'The conversation ID to extract action items from' }, auto_create_tasks: { type: 'boolean', default: false, description: 'Whether to automatically create tasks for action items' } }, required: ['conversation_id'] } }
  • Core extraction logic: Scans conversation messages with regex patterns to detect action items (e.g., 'need to', 'todo'), extracts title/description, computes priority and confidence scores using helper functions, and returns array of structured action items.
    function extractActionItemsFromConversation(messages: Message[], context?: any): any[] { const actionItems: any[] = [] // Simple regex patterns for action items const patterns = [ /(?:need to|should|must|will|todo|action item):?\s*(.+)/gi, /(?:let's|we'll|i'll|you'll)\s+(.+)/gi, /(?:next step|follow up|follow-up):?\s*(.+)/gi ] messages.forEach((message, index) => { patterns.forEach(pattern => { const matches = [...message.content.matchAll(pattern)] matches.forEach(match => { if (match[1] && match[1].length > 10 && match[1].length < 200) { actionItems.push({ title: match[1].trim(), description: `From conversation: "${message.content.substring(0, 100)}..."`, source_message_index: index, source_role: message.role, priority: determinePriority(match[1]), confidence: calculateConfidence(match[1], message.content), context }) } }) }) }) return actionItems }
  • Exports the handler mapping including 'extract_action_items' mapped to the extractActionItems function, used for MCP tool registration.
    export const conversationHandlers = { save_conversation: saveConversation, get_conversations: getConversations, analyze_conversation: analyzeConversation, extract_action_items: extractActionItems, generate_conversation_summary: generateConversationSummary }

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/jakedx6/helios9-MCP-Server'

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