update_initiative
Update initiative details including name, objective, status, priority, dates, and metadata to keep project information current.
Instructions
Update initiative details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| initiative_id | Yes | The unique identifier of the initiative to update | |
| name | No | New name for the initiative | |
| objective | No | New objective | |
| description | No | New description | |
| status | No | New status | |
| priority | No | New priority | |
| owner_id | No | New owner ID | |
| start_date | No | New start date | |
| target_date | No | New target date | |
| metadata | No | New metadata | |
| tags | No | New tags |
Implementation Reference
- src/tools/initiatives.ts:337-350 (handler)The main handler function for the update_initiative tool. Calls UpdateInitiativeSchema.parse to validate args, logs the update, calls supabaseService.updateInitiative() to perform the update, and returns the updated initiative with a success message.
export const updateInitiative = requireAuth(async (args: any) => { const { initiative_id, ...updates } = UpdateInitiativeSchema.parse(args) logger.info('Updating initiative', { initiative_id, updates }) const initiative = await supabaseService.updateInitiative(initiative_id, updates) logger.info('Initiative updated successfully', { initiative_id: initiative.id }) return { initiative, message: `Initiative "${initiative.name}" updated successfully` } }) - src/tools/initiatives.ts:40-52 (schema)Zod schema for update_initiative input validation. Requires initiative_id (UUID) and allows optional fields: name, objective, description, status, priority, owner_id, start_date, target_date, metadata, tags.
const UpdateInitiativeSchema = z.object({ initiative_id: z.string().uuid(), name: z.string().min(1).max(255).optional(), objective: z.string().min(1).optional(), description: z.string().optional(), status: z.enum(['planning', 'active', 'on_hold', 'completed', 'cancelled']).optional(), priority: z.enum(['critical', 'high', 'medium', 'low']).optional(), owner_id: z.string().uuid().optional(), 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:270-335 (registration)Tool registration object (updateInitiativeTool) with name 'update_initiative', description, and JSON Schema input schema defining all optional/required properties for the tool.
export const updateInitiativeTool: MCPTool = { name: 'update_initiative', description: 'Update initiative details', inputSchema: { type: 'object', properties: { initiative_id: { type: 'string', format: 'uuid', description: 'The unique identifier of the initiative to update' }, name: { type: 'string', minLength: 1, maxLength: 255, description: 'New name for the initiative' }, objective: { type: 'string', minLength: 1, description: 'New objective' }, description: { type: 'string', description: 'New description' }, status: { type: 'string', enum: ['planning', 'active', 'on_hold', 'completed', 'cancelled'], description: 'New status' }, priority: { type: 'string', enum: ['critical', 'high', 'medium', 'low'], description: 'New priority' }, owner_id: { type: 'string', format: 'uuid', description: 'New owner ID' }, start_date: { type: 'string', format: 'date-time', description: 'New start date' }, target_date: { type: 'string', format: 'date-time', description: 'New target date' }, metadata: { type: 'object', description: 'New metadata' }, tags: { type: 'array', items: { type: 'string' }, description: 'New tags' } }, required: ['initiative_id'] } } - src/tools/initiatives.ts:630-634 (registration)Handler registration mapping the string 'update_initiative' to the updateInitiative handler function in the initiativeHandlers export object.
export const initiativeHandlers = { list_initiatives: listInitiatives, get_initiative: getInitiative, create_initiative: createInitiative, update_initiative: updateInitiative, - src/lib/api-client.ts:534-541 (helper)The helper API client method updateInitiative that makes a PATCH request to /api/mcp/initiatives/{initiativeId} with the partial update data.
async updateInitiative(initiativeId: string, updates: Partial<Initiative>): Promise<Initiative> { const response = await this.request<{ initiative: Initiative }>(`/api/mcp/initiatives/${initiativeId}`, { method: 'PATCH', body: JSON.stringify(updates), }) return response.initiative }