disassociate_document_from_initiative
Remove a document from an initiative in Helios-9 project management to maintain accurate resource organization and project clarity.
Instructions
Remove the link between a document and an initiative
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| initiative_id | Yes | The initiative ID to disassociate the document from | |
| document_id | Yes | The document ID to disassociate from the initiative |
Implementation Reference
- src/tools/initiatives.ts:594-613 (handler)The main handler function that executes the MCP tool logic. Validates input parameters using Zod, logs the action, calls the supabaseService helper to perform the disassociation, logs success, and returns a structured response.export const disassociateDocumentFromInitiative = requireAuth(async (args: any) => { const { initiative_id, document_id } = z.object({ initiative_id: z.string().uuid(), document_id: z.string().uuid() }).parse(args) logger.info('Disassociating document from initiative', { initiative_id, document_id }) // Call the API to remove the association const response = await supabaseService.disassociateDocumentFromInitiative(initiative_id, document_id) logger.info('Document disassociated from initiative successfully') return { success: true, message: `Document successfully disassociated from initiative`, initiative_id, document_id } })
- src/tools/initiatives.ts:573-592 (schema)Defines the MCPTool metadata including the tool name, description, and JSON inputSchema for validation of initiative_id and document_id parameters.export const disassociateDocumentFromInitiativeTool: MCPTool = { name: 'disassociate_document_from_initiative', description: 'Remove the link between a document and an initiative', inputSchema: { type: 'object', properties: { initiative_id: { type: 'string', format: 'uuid', description: 'The initiative ID to disassociate the document from' }, document_id: { type: 'string', format: 'uuid', description: 'The document ID to disassociate from the initiative' } }, required: ['initiative_id', 'document_id'] } }
- src/tools/initiatives.ts:630-642 (registration)Maps the tool name 'disassociate_document_from_initiative' to its handler function as part of the initiativeHandlers export used for tool registration.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:576-583 (helper)Supporting API client method (supabaseService.disassociateDocumentFromInitiative) called by the handler. Performs the actual HTTP DELETE request to the backend API to remove the document-initiative association.async disassociateDocumentFromInitiative(initiativeId: string, documentId: string): Promise<any> { const response = await this.request<{ success: boolean }>(`/api/mcp/initiatives/${initiativeId}/documents/${documentId}`, { method: 'DELETE', }) logger.info(`Document ${documentId} disassociated from initiative ${initiativeId}`) return response }