generate_daily_summary
Generate daily productivity summaries by analyzing Slack, Calendar, and Gmail activity for end-of-day wrap-ups and next-day planning.
Instructions
Generate a concise daily productivity summary from today's Slack, Calendar, and Gmail activity. Perfect for end-of-day wrap-ups and next-day planning.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date to summarize in YYYY-MM-DD format (default: today) | |
| output_format | No | Output format(s) to generate (default: both) | both |
| save_to_file | No | Whether to save output to summaries directory (default: true) | |
| include_sections | No | Sections to include (default: all) |
Implementation Reference
- Main execution logic for the generate_daily_summary tool, handling arguments, generating instructions and template, processing collected data, and saving outputs.export async function generateDailySummary(args) { const startTime = Date.now(); try { // Get the date (default to today) const targetDate = args.date || new Date().toISOString().split('T')[0]; const startDate = targetDate; const endDate = targetDate; const outputFormat = args.output_format || config.defaults.outputFormat; const saveToFile = args.save_to_file !== false; const includeSections = args.include_sections || ['meetings', 'communications', 'accomplishments', 'tomorrow']; // Generate data collection instructions for the AI const instructions = generateDailyDataCollectionInstructions(targetDate); // Generate summary template const summaryTemplate = generateDailySummaryTemplate(targetDate, includeSections); // Prepare response structure const result = { success: true, message: 'Daily summary generation initiated. Please follow the data collection instructions below.', date: targetDate, instructions, template: summaryTemplate, output_format: outputFormat, save_to_file: saveToFile, note: 'This tool provides instructions for the AI agent to collect today\'s data and generate a concise daily summary.', }; // If the AI has already collected data (passed in args), process it if (args.collected_data) { result.summary = await processDailySummaryData(args.collected_data, targetDate, includeSections); // Save to file if requested if (saveToFile) { const files = []; if (outputFormat === 'both' || outputFormat === 'html') { const htmlFilename = `daily-summary-${targetDate}.html`; const htmlPath = await saveSummary(result.summary.html, htmlFilename); files.push(htmlPath); } if (outputFormat === 'both' || outputFormat === 'markdown') { const mdFilename = `daily-summary-${targetDate}.md`; const mdPath = await saveSummary(result.summary.markdown, mdFilename); files.push(mdPath); } result.files_saved = files; } } result.generation_time_ms = Date.now() - startTime; return result; } catch (error) { throw { code: error.code || 'GENERATION_FAILED', message: error.message || 'Failed to generate daily summary', details: error.details || error.stack, }; } }
- src/tools/index.js:12-44 (schema)Input schema and description for the generate_daily_summary tool, defining parameters like date, output_format, etc.{ name: 'generate_daily_summary', description: 'Generate a concise daily productivity summary from today\'s Slack, Calendar, and Gmail activity. Perfect for end-of-day wrap-ups and next-day planning.', inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'Date to summarize in YYYY-MM-DD format (default: today)', pattern: '^\\d{4}-\\d{2}-\\d{2}$', }, output_format: { type: 'string', enum: ['both', 'html', 'markdown', 'json'], description: 'Output format(s) to generate (default: both)', default: 'both', }, save_to_file: { type: 'boolean', description: 'Whether to save output to summaries directory (default: true)', default: true, }, include_sections: { type: 'array', items: { type: 'string', enum: ['meetings', 'communications', 'accomplishments', 'tomorrow'], }, description: 'Sections to include (default: all)', }, }, }, },
- src/tools/handler.js:23-25 (registration)Registration of the generate_daily_summary tool in the central tool dispatcher switch statement.case 'generate_daily_summary': result = await generateDailySummary(args); break;
- Helper function to generate the structure/template for the daily summary sections.function generateDailySummaryTemplate(date, sections) { const template = { date: date, display: formatDisplayDate(date), sections: {}, }; if (sections.includes('meetings')) { template.sections.meetings = { total: 0, hours: 0, key_meetings: [], outcomes: [], }; } if (sections.includes('communications')) { template.sections.communications = { slack_messages: 0, important_threads: [], emails: 0, key_contacts: [], }; } if (sections.includes('accomplishments')) { template.sections.accomplishments = [ 'Key accomplishments and completed tasks', ]; } if (sections.includes('tomorrow')) { template.sections.tomorrow = { upcoming_meetings: [], action_items: [], prep_needed: [], }; } return template; }