get_project_insights
Analyze project data to identify progress, bottlenecks, team performance, documentation health, and AI readiness with actionable recommendations.
Instructions
Get deep analytics and insights for a specific project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID to analyze | |
| insight_types | No | Types of insights to generate | |
| include_recommendations | No | Whether to include actionable recommendations |
Implementation Reference
- src/tools/context-aggregation.ts:259-306 (handler)The core handler function `getProjectInsights` that executes the tool logic. Parses arguments, fetches project data, generates insights based on specified types using helper functions, adds recommendations, computes health score, and returns structured insights object.export const getProjectInsights = requireAuth(async (args: any) => { const { project_id, insight_types, include_recommendations } = GetProjectInsightsSchema.parse(args) logger.info('Getting project insights', { project_id, insight_types }) const project = await supabaseService.getProject(project_id) const projectContext = await supabaseService.getProjectContext(project_id) const insights: any = { project_overview: { id: project.id, name: project.name, status: project.status, created_at: project.created_at, updated_at: project.updated_at } } // Generate requested insights for (const insightType of insight_types) { switch (insightType) { case 'progress': insights.progress_analysis = analyzeProjectProgress(projectContext) break case 'bottlenecks': insights.bottleneck_analysis = identifyProjectBottlenecks(projectContext) break case 'team_performance': insights.team_performance = analyzeTeamPerformance(projectContext) break case 'documentation_health': insights.documentation_health = analyzeDocumentationHealth(projectContext) break case 'ai_readiness': insights.ai_readiness = assessProjectAIReadiness(projectContext) break } } if (include_recommendations) { insights.recommendations = generateProjectRecommendations(insights, projectContext) } insights.overall_health_score = calculateOverallHealthScore(insights) return insights })
- Zod schema `GetProjectInsightsSchema` for input validation, defining `project_id` (required UUID), `insight_types` (array of insight enums, default ['progress', 'bottlenecks']), and `include_recommendations` (boolean, default true).const GetProjectInsightsSchema = z.object({ project_id: z.string().uuid(), insight_types: z.array(z.enum(['progress', 'bottlenecks', 'team_performance', 'documentation_health', 'ai_readiness'])).default(['progress', 'bottlenecks']), include_recommendations: z.boolean().default(true) })
- src/tools/context-aggregation.ts:229-257 (registration)MCPTool definition `getProjectInsightsTool` registering the tool with name 'get_project_insights', description, and input schema matching the Zod schema.export const getProjectInsightsTool: MCPTool = { name: 'get_project_insights', description: 'Get deep analytics and insights for a specific project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', format: 'uuid', description: 'The project ID to analyze' }, insight_types: { type: 'array', items: { type: 'string', enum: ['progress', 'bottlenecks', 'team_performance', 'documentation_health', 'ai_readiness'] }, default: ['progress', 'bottlenecks'], description: 'Types of insights to generate' }, include_recommendations: { type: 'boolean', default: true, description: 'Whether to include actionable recommendations' } }, required: ['project_id'] } }
- src/tools/context-aggregation.ts:724-730 (registration)Registration of the handler function in the `contextAggregationHandlers` object under the key 'get_project_insights', likely used to populate allHandlers in the main application.export const contextAggregationHandlers = { get_smart_context: getSmartContext, get_workspace_overview: getWorkspaceOverview, get_project_insights: getProjectInsights, find_related_content: findRelatedContent, generate_context_summary: generateContextSummary }
- src/tools/context-aggregation.ts:716-722 (registration)Export of tools array/object including `getProjectInsightsTool` for aggregation and likely global tool registration.export const contextAggregationTools = { getSmartContextTool, getWorkspaceOverviewTool, getProjectInsightsTool, findRelatedContentTool, generateContextSummaryTool }