get_initiative_context
Retrieve detailed context about a specific initiative to enhance AI understanding of project scope, requirements, and relationships.
Instructions
Get rich context about an initiative for AI understanding
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| initiative_id | Yes | The unique identifier of the initiative |
Implementation Reference
- src/tools/initiatives.ts:371-379 (handler)The main execution handler for the 'get_initiative_context' tool. Validates input using GetInitiativeSchema, logs the request, fetches context from supabaseService, and returns it.export const getInitiativeContext = requireAuth(async (args: any) => { const { initiative_id } = GetInitiativeSchema.parse(args) logger.info('Getting initiative context for AI', { initiative_id }) const context = await supabaseService.getInitiativeContext(initiative_id) return { context } })
- src/tools/initiatives.ts:355-369 (schema)The MCPTool definition including name, description, and input schema JSON for 'get_initiative_context'.export const getInitiativeContextTool: MCPTool = { name: 'get_initiative_context', description: 'Get rich context about an initiative for AI understanding', inputSchema: { type: 'object', properties: { initiative_id: { type: 'string', format: 'uuid', description: 'The unique identifier of the initiative' } }, required: ['initiative_id'] } }
- src/tools/initiatives.ts:22-24 (schema)Zod schema used for input validation in the handler.const GetInitiativeSchema = z.object({ initiative_id: z.string().uuid() })
- src/tools/initiatives.ts:630-642 (registration)Registration mapping of tool name to handler function, exported for use in main tool registry.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 }
- src/lib/api-client.ts:543-546 (helper)Helper method in API client that makes the actual API request to fetch initiative context.async getInitiativeContext(initiativeId: string): Promise<any> { const response = await this.request<{ context: any }>(`/api/mcp/initiatives/${initiativeId}/context`) return response.context }