Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

add_document_collaborator

Grant document access to users with specific permissions like read, comment, edit, or admin control. Specify document and user IDs to manage collaboration.

Instructions

Add a collaborator to a document with specific permissions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesID of the document
user_idYesID of the user to add as collaborator
permission_levelNoPermission level for the collaboratoredit
notifyNoWhether to notify the user about collaboration invite

Implementation Reference

  • Main handler function executing the tool: validates input, retrieves document, creates collaboration record via supabaseService, and returns result.
    export const addDocumentCollaborator = requireAuth(async (args: any) => {
      const { document_id, user_id, permission_level, notify } = AddDocumentCollaboratorSchema.parse(args)
      
      logger.info('Adding document collaborator', { document_id, user_id, permission_level })
    
      // Get document and verify permissions
      const document = await supabaseService.getDocument(document_id)
      if (!document) {
        throw new Error('Document not found')
      }
    
      // Create collaboration record
      const collaboration = await supabaseService.createDocumentCollaboration({
        document_id,
        user_id,
        permission_level,
        status: 'active',
        invited_at: new Date().toISOString()
      })
    
      // Note: metadata field doesn't exist in the database schema
      // Collaboration would be tracked in a separate table
    
      return {
        collaboration,
        document: await supabaseService.getDocument(document_id),
        message: `User added as ${permission_level} collaborator`
      }
    })
  • Zod schema for input validation in the handler.
    const AddDocumentCollaboratorSchema = z.object({
      document_id: z.string().min(1),
      user_id: z.string().min(1),
      permission_level: z.enum(['read', 'comment', 'edit', 'admin']).default('edit'),
      notify: z.boolean().default(true)
    })
  • MCPTool definition including the JSON input schema for the tool.
    export const addDocumentCollaboratorTool: MCPTool = {
      name: 'add_document_collaborator',
      description: 'Add a collaborator to a document with specific permissions',
      inputSchema: {
        type: 'object',
        properties: {
          document_id: {
            type: 'string',
            description: 'ID of the document'
          },
          user_id: {
            type: 'string',
            description: 'ID of the user to add as collaborator'
          },
          permission_level: {
            type: 'string',
            enum: ['read', 'comment', 'edit', 'admin'],
            default: 'edit',
            description: 'Permission level for the collaborator'
          },
          notify: {
            type: 'boolean',
            default: true,
            description: 'Whether to notify the user about collaboration invite'
          }
        },
        required: ['document_id', 'user_id']
      }
    }
  • Registration of all document handlers, including 'add_document_collaborator' mapping to addDocumentCollaborator function.
    export const documentHandlers = {
      list_documents: listDocuments,
      create_document: createDocument,
      get_document: getDocument,
      update_document: updateDocument,
      search_documents: searchDocuments,
      get_document_context: getDocumentContext,
      add_document_collaborator: addDocumentCollaborator,
      analyze_document_content: analyzeDocumentContent,
      get_document_collaboration: getDocumentCollaboration,
      generate_document_template: generateDocumentTemplate,
      bulk_document_operations: bulkDocumentOperations
    }
  • Export of all document MCPTools, including addDocumentCollaboratorTool.
    export const documentTools = {
      listDocumentsTool,
      createDocumentTool,
      getDocumentTool,
      updateDocumentTool,
      searchDocumentsTool,
      getDocumentContextTool,
      addDocumentCollaboratorTool,
      analyzeDocumentContentTool,
      getDocumentCollaborationTool,
      generateDocumentTemplateTool,
      bulkDocumentOperationsTool
    }

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