get_initiative
Retrieve detailed information about a specific project initiative using its unique identifier to access comprehensive data and manage project elements.
Instructions
Get detailed information about a specific initiative
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| initiative_id | Yes | The unique identifier of the initiative |
Implementation Reference
- src/tools/initiatives.ts:131-158 (handler)The handler function for the 'get_initiative' tool. It validates input using GetInitiativeSchema, fetches the initiative data from supabaseService, computes completion statistics and percentages, and returns an enriched initiative object.export const getInitiative = requireAuth(async (args: any) => { const { initiative_id } = GetInitiativeSchema.parse(args) logger.info('Getting initiative details', { initiative_id }) const initiative = await supabaseService.getInitiative(initiative_id) // If the API returns enriched data with tasks, milestones, and documents, calculate from that const statistics = { total_tasks: initiative.tasks?.length || initiative.task_count || 0, completed_tasks: initiative.tasks?.filter((t: any) => t.status === 'done').length || 0, total_milestones: initiative.milestones?.length || initiative.milestone_count || 0, completed_milestones: initiative.milestones?.filter((m: any) => m.status === 'completed').length || 0, total_documents: initiative.documents?.length || initiative.document_count || 0 } const completion_percentage = statistics.total_tasks > 0 ? Math.round((statistics.completed_tasks / statistics.total_tasks) * 100) : 0 return { initiative: { ...initiative, completion_percentage, statistics } } })
- src/tools/initiatives.ts:22-24 (schema)Zod input validation schema used in the get_initiative handler.const GetInitiativeSchema = z.object({ initiative_id: z.string().uuid() })
- src/tools/initiatives.ts:115-129 (registration)MCPTool object registering the 'get_initiative' tool with name, description, and JSON input schema.export const getInitiativeTool: MCPTool = { name: 'get_initiative', description: 'Get detailed information about a specific initiative', inputSchema: { type: 'object', properties: { initiative_id: { type: 'string', format: 'uuid', description: 'The unique identifier of the initiative' } }, required: ['initiative_id'] } }