Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

update_document

Modify existing documents by updating content, titles, types, or metadata in the Helios-9 MCP Server's project management system.

Instructions

Update an existing document with new content or metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesThe unique identifier of the document to update
titleNoNew title for the document
contentNoNew markdown content for the document
document_typeNoNew document type
metadataNoUpdated metadata for the document

Implementation Reference

  • The core handler function for the 'update_document' MCP tool. It validates input using UpdateDocumentSchema, performs content analysis if content is updated, calls supabaseService.updateDocument, and returns the updated document with analysis.
    export const updateDocument = requireAuth(async (args: any) => {
      const { document_id, ...updates } = UpdateDocumentSchema.parse(args)
      
      logger.info('Updating document', { document_id, updates: Object.keys(updates) })
      
      // Analyze content if it's being updated
      let contentAnalysis = undefined
      if (updates.content) {
        const currentDoc = await supabaseService.getDocument(document_id)
        contentAnalysis = analyzeDocumentContentHelper(updates.content, updates.document_type || currentDoc.document_type)
        
        // Removed metadata updates as metadata doesn't exist in the database schema
      }
      
      const document = await supabaseService.updateDocument(document_id, updates)
      
      logger.info('Document updated successfully', { document_id: document.id })
      
      return {
        document,
        content_analysis: contentAnalysis,
        message: `Document "${document.title}" updated successfully`
      }
    })
  • Zod schema for validating input parameters to the update_document tool.
    const UpdateDocumentSchema = z.object({
      document_id: z.string().uuid(),
      title: z.string().min(1).max(500).optional(),
      content: z.string().optional(),
      document_type: z.enum(['requirement', 'design', 'technical', 'meeting_notes', 'other']).optional(),
      metadata: z.record(z.any()).optional()
    })
  • MCPTool definition for 'update_document', including name, description, and inputSchema for the tool registry.
    export const updateDocumentTool: MCPTool = {
      name: 'update_document',
      description: 'Update an existing document with new content or metadata',
      inputSchema: {
        type: 'object',
        properties: {
          document_id: {
            type: 'string',
            format: 'uuid',
            description: 'The unique identifier of the document to update'
          },
          title: {
            type: 'string',
            minLength: 1,
            maxLength: 500,
            description: 'New title for the document'
          },
          content: {
            type: 'string',
            description: 'New markdown content for the document'
          },
          document_type: {
            type: 'string',
            enum: ['requirement', 'design', 'technical', 'meeting_notes', 'other'],
            description: 'New document type'
          },
          metadata: {
            type: 'object',
            description: 'Updated metadata for the document'
          }
        },
        required: ['document_id']
      }
    }
  • Object mapping tool names to their handler functions, including 'update_document': updateDocument. Likely used for tool registration in the MCP server.
    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
    }
  • Underlying API client method supabaseService.updateDocument that performs the actual database update via PATCH /api/mcp/documents/{documentId}.
    async updateDocument(documentId: string, updates: Partial<Document>): Promise<Document> {
      const response = await this.request<{ document: Document }>(`/api/mcp/documents/${documentId}`, {
        method: 'PATCH',
        body: JSON.stringify(updates),
      })
      
      return response.document
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states this is an update operation, implying mutation, but doesn't disclose behavioral traits such as permission requirements, whether changes are reversible, rate limits, or what happens to unspecified fields. This is a significant gap for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks crucial behavioral context, usage guidelines, and details on return values or error handling, leaving significant gaps for an AI agent to operate effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what the schema provides, such as explaining interactions between parameters or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'update' and the resource 'document', and specifies what can be updated ('content or metadata'), which provides a specific purpose. However, it doesn't explicitly distinguish this tool from its sibling 'bulk_document_operations' or 'create_document', which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'bulk_document_operations' or 'create_document'. It mentions updating 'existing' documents, which implies a prerequisite but doesn't state when this tool is preferred over other update-related tools in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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