Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

associate_document_with_initiative

Link existing documents to initiatives within the Helios-9 MCP Server to organize project materials and maintain clear relationships between resources.

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

  • The core handler function for the 'associate_document_with_initiative' MCP tool. It validates UUID inputs, 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
      }
    })
  • The MCPTool object defining the tool name, description, and input schema (JSON Schema) for input validation.
    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 under its snake_case name in the initiativeHandlers export object, used for MCP 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
    }
  • Export grouping all initiative MCPTool definitions, including associateDocumentWithInitiativeTool.
    export const initiativeTools = {
      listInitiativesTool,
      getInitiativeTool,
      createInitiativeTool,
      updateInitiativeTool,
      getInitiativeContextTool,
      getInitiativeInsightsTool,
      searchWorkspaceTool,
      getEnhancedProjectContextTool,
      getWorkspaceContextTool,
      associateDocumentWithInitiativeTool,
      disassociateDocumentFromInitiativeTool
    }
  • Helper method in supabaseService (ApiClient) that makes the actual API POST request 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