get_initiative_context
Retrieve detailed context about project initiatives to enhance AI understanding and decision-making for project management tasks.
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 handler function that executes the tool logic. It requires authentication, validates input with Zod (GetInitiativeSchema), logs the request, fetches the initiative context from the Supabase service, and returns the context.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 providing the tool's name, description, and input schema (requiring initiative_id as UUID). This is used by the MCP server for tool listing and validation.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:630-642 (registration)Local registration of all initiative-related handlers, mapping the tool name 'get_initiative_context' to its handler function.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/index.ts:143-155 (registration)Global registration in the main MCP server: initiativeHandlers (including get_initiative_context) is spread into the allHandlers object used by the server to dispatch tool calls.this.allHandlers = { ...projectHandlers, ...taskHandlers, ...documentHandlers, ...conversationHandlers, ...contextAggregationHandlers, ...workflowAutomationHandlers, ...intelligentSearchHandlers, ...analyticsInsightsHandlers, ...initiativeHandlers, ...promptToProjectTools.reduce((acc, tool) => ({ ...acc, [tool.name]: tool.handler }), {}), ...debugHandlers, }
- src/lib/api-client.ts:543-546 (helper)Supporting service method (supabaseService.getInitiativeContext) called by the handler to fetch the actual initiative context data from the backend API.async getInitiativeContext(initiativeId: string): Promise<any> { const response = await this.request<{ context: any }>(`/api/mcp/initiatives/${initiativeId}/context`) return response.context }