generate_context_summary
Generate intelligent summaries from aggregated context data including projects, tasks, documents, and conversations, with customizable focus for different audiences.
Instructions
Generate intelligent summary from aggregated context data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_data | Yes | Aggregated context data to summarize | |
| summary_focus | No | Focus of the summary | overview |
| target_audience | No | Target audience for the summary | ai_agent |
Implementation Reference
- src/tools/context-aggregation.ts:417-437 (handler)The primary handler function that executes the tool logic. It validates input with GenerateContextSummarySchema, generates various summary sections using helper functions (generateExecutiveSummary, extractKeyMetrics, etc.), and returns a structured summary object.export const generateContextSummary = requireAuth(async (args: any) => { const { context_data, summary_focus, target_audience } = GenerateContextSummarySchema.parse(args) logger.info('Generating context summary', { summary_focus, target_audience }) const summary = { executive_summary: generateExecutiveSummary(context_data, summary_focus), key_metrics: extractKeyMetrics(context_data), insights: generateInsights(context_data, summary_focus), action_items: extractActionItems(context_data), recommendations: generateRecommendations(context_data, target_audience), metadata: { generated_at: new Date().toISOString(), summary_focus, target_audience, data_sources: Object.keys(context_data).filter(key => (context_data as any)[key]?.length > 0) } } return summary })
- Zod schema defining the input structure for the generate_context_summary tool, including context_data object with optional arrays for projects, tasks, etc., and enums for summary_focus and target_audience.const GenerateContextSummarySchema = z.object({ context_data: z.object({ projects: z.array(z.any()).optional(), tasks: z.array(z.any()).optional(), documents: z.array(z.any()).optional(), conversations: z.array(z.any()).optional() }), summary_focus: z.enum(['overview', 'action_items', 'blockers', 'opportunities']).default('overview'), target_audience: z.enum(['developer', 'manager', 'ai_agent']).default('ai_agent') })
- src/tools/context-aggregation.ts:383-414 (registration)MCPTool registration object defining the tool name 'generate_context_summary', description, and inputSchema matching the Zod schema.export const generateContextSummaryTool: MCPTool = { name: 'generate_context_summary', description: 'Generate intelligent summary from aggregated context data', inputSchema: { type: 'object', properties: { context_data: { type: 'object', properties: { projects: { type: 'array' }, tasks: { type: 'array' }, documents: { type: 'array' }, conversations: { type: 'array' } }, description: 'Aggregated context data to summarize' }, summary_focus: { type: 'string', enum: ['overview', 'action_items', 'blockers', 'opportunities'], default: 'overview', description: 'Focus of the summary' }, target_audience: { type: 'string', enum: ['developer', 'manager', 'ai_agent'], default: 'ai_agent', description: 'Target audience for the summary' } }, required: ['context_data'] } }
- src/tools/context-aggregation.ts:724-730 (registration)Export mapping handler names to functions, registering 'generate_context_summary' to the generateContextSummary handler.export const contextAggregationHandlers = { get_smart_context: getSmartContext, get_workspace_overview: getWorkspaceOverview, get_project_insights: getProjectInsights, find_related_content: findRelatedContent, generate_context_summary: generateContextSummary }