create_initiative
Create a new strategic initiative with objectives, priority, and project associations to organize and track organizational goals within the Helios-9 project management system.
Instructions
Create a new initiative
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the initiative | |
| objective | Yes | The strategic objective of the initiative | |
| description | No | Optional detailed description | |
| status | No | Initial status of the initiative | planning |
| priority | No | Priority level | medium |
| owner_id | Yes | ID of the initiative owner | |
| project_ids | Yes | IDs of projects this initiative belongs to (at least one required) | |
| start_date | No | Optional start date | |
| target_date | No | Optional target completion date | |
| metadata | No | Optional metadata | |
| tags | No | Optional tags |
Implementation Reference
- src/tools/initiatives.ts:236-265 (handler)The core handler function for the 'create_initiative' MCP tool. Validates input with Zod schema, logs the creation, calls the Supabase service to create the initiative, and returns the result with a success message.export const createInitiative = requireAuth(async (args: any) => { const initiativeData = CreateInitiativeSchema.parse(args) logger.info('Creating new initiative', { name: initiativeData.name, project_ids: initiativeData.project_ids }) // Create the initiative with project_ids included const initiative = await supabaseService.createInitiative({ name: initiativeData.name, objective: initiativeData.objective, description: initiativeData.description || null, status: initiativeData.status, priority: initiativeData.priority, owner_id: initiativeData.owner_id, start_date: initiativeData.start_date || null, target_date: initiativeData.target_date || null, metadata: initiativeData.metadata || {}, tags: initiativeData.tags || [], project_ids: initiativeData.project_ids // Pass project_ids to API } as any) logger.info('Initiative created successfully', { initiative_id: initiative.id, name: initiative.name }) return { initiative, message: `Initiative "${initiative.name}" created successfully` } })
- src/tools/initiatives.ts:26-38 (schema)Zod input validation schema for the create_initiative tool, defining all required and optional fields with types and constraints.const CreateInitiativeSchema = z.object({ name: z.string().min(1).max(255), objective: z.string().min(1), description: z.string().optional(), status: z.enum(['planning', 'active', 'on_hold', 'completed', 'cancelled']).default('planning'), priority: z.enum(['critical', 'high', 'medium', 'low']).default('medium'), owner_id: z.string().uuid(), project_ids: z.array(z.string().uuid()).min(1), // Required: at least one project start_date: z.string().datetime().optional(), target_date: z.string().datetime().optional(), metadata: z.object({}).optional(), tags: z.array(z.string()).optional() })
- src/tools/initiatives.ts:163-234 (registration)MCPTool object registration defining the 'create_initiative' tool with name, description, and JSON Schema for input validation.export const createInitiativeTool: MCPTool = { name: 'create_initiative', description: 'Create a new initiative', inputSchema: { type: 'object', properties: { name: { type: 'string', minLength: 1, maxLength: 255, description: 'The name of the initiative' }, objective: { type: 'string', minLength: 1, description: 'The strategic objective of the initiative' }, description: { type: 'string', description: 'Optional detailed description' }, status: { type: 'string', enum: ['planning', 'active', 'on_hold', 'completed', 'cancelled'], default: 'planning', description: 'Initial status of the initiative' }, priority: { type: 'string', enum: ['critical', 'high', 'medium', 'low'], default: 'medium', description: 'Priority level' }, owner_id: { type: 'string', format: 'uuid', description: 'ID of the initiative owner' }, project_ids: { type: 'array', items: { type: 'string', format: 'uuid' }, minItems: 1, description: 'IDs of projects this initiative belongs to (at least one required)' }, start_date: { type: 'string', format: 'date-time', description: 'Optional start date' }, target_date: { type: 'string', format: 'date-time', description: 'Optional target completion date' }, metadata: { type: 'object', description: 'Optional metadata' }, tags: { type: 'array', items: { type: 'string' }, description: 'Optional tags' } }, required: ['name', 'objective', 'owner_id', 'project_ids'] } }
- src/tools/initiatives.ts:630-642 (registration)Handler mapping registration where 'create_initiative' key is mapped to the createInitiative function, likely used by the MCP server to dispatch calls.export const initiativeHandlers = { list_initiatives: listInitiatives, get_initiative: getInitiative, create_initiative: createInitiative, update_initiative: updateInitiative, get_initiative_context: getInitiativeContext, get_initiative_insights: getInitiativeInsights, search_workspace: searchWorkspace, get_enhanced_project_context: getEnhancedProjectContext, get_workspace_context: getWorkspaceContext, associate_document_with_initiative: associateDocumentWithInitiative, disassociate_document_from_initiative: disassociateDocumentFromInitiative }