Skip to main content
Glama
jakedx6
by jakedx6

associate_document_with_initiative

Link existing documents to initiatives for better project organization and tracking within the Helios-9 MCP Server.

Instructions

Link an existing document to an initiative

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
initiative_idYesThe initiative ID to associate the document with
document_idYesThe document ID to associate with the initiative

Implementation Reference

  • Main handler function that validates input parameters (initiative_id and document_id), logs the action, calls the supabaseService to perform the association, and returns a success response.
    export const associateDocumentWithInitiative = 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('Associating document with initiative', { initiative_id, document_id }) // Call the API to create the association const response = await supabaseService.associateDocumentWithInitiative(initiative_id, document_id) logger.info('Document associated with initiative successfully') return { success: true, message: `Document successfully associated with initiative`, initiative_id, document_id } })
  • Tool definition including name, description, and input schema requiring initiative_id and document_id as UUID strings.
    export const associateDocumentWithInitiativeTool: MCPTool = { name: 'associate_document_with_initiative', description: 'Link an existing document to an initiative', inputSchema: { type: 'object', properties: { initiative_id: { type: 'string', format: 'uuid', description: 'The initiative ID to associate the document with' }, document_id: { type: 'string', format: 'uuid', description: 'The document ID to associate with the initiative' } }, required: ['initiative_id', 'document_id'] } }
  • Registration of the tool handler in the initiativeHandlers object, mapping 'associate_document_with_initiative' 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 }
  • Registration of the tool schema in the initiativeTools object.
    export const initiativeTools = { listInitiativesTool, getInitiativeTool, createInitiativeTool, updateInitiativeTool, getInitiativeContextTool, getInitiativeInsightsTool, searchWorkspaceTool, getEnhancedProjectContextTool, getWorkspaceContextTool, associateDocumentWithInitiativeTool, disassociateDocumentFromInitiativeTool }
  • Helper method in API client (supabaseService) that makes the HTTP POST request to the backend API to associate a document with an initiative.
    async associateDocumentWithInitiative(initiativeId: string, documentId: string): Promise<any> { const response = await this.request<{ success: boolean }>(`/api/mcp/initiatives/${initiativeId}/documents`, { method: 'POST', body: JSON.stringify({ document_id: documentId }), }) logger.info(`Document ${documentId} associated with initiative ${initiativeId}`) return response }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jakedx6/helios9-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server