Skip to main content
Glama
jakedx6
by jakedx6

create_document

Create new markdown documents with structured metadata for project management in Helios-9, supporting requirements, designs, technical specs, and meeting notes.

Instructions

Create a new document with markdown content and optional frontmatter metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID to associate the document with (required)
titleYesThe title of the document
contentYesThe markdown content of the document (can include YAML frontmatter)
document_typeYesThe type of document being created
metadataNoAdditional metadata for the document

Implementation Reference

  • The main handler function for the 'create_document' tool. It validates input using CreateDocumentSchema, performs content analysis, creates the document using supabaseService.createDocument, logs the action, and returns the created document with analysis results.
    export const createDocument = requireAuth(async (args: any) => { const documentData = CreateDocumentSchema.parse(args) logger.info('Creating new document', { project_id: documentData.project_id, title: documentData.title, document_type: documentData.document_type }) // Parse frontmatter and analyze content const contentAnalysis = analyzeDocumentContentHelper(documentData.content, documentData.document_type) // Validate that project_id is provided if (!documentData.project_id) { throw new Error('project_id is required for document creation') } const document = await supabaseService.createDocument({ project_id: documentData.project_id, title: documentData.title, content: documentData.content, document_type: documentData.document_type // Removed format and metadata as they don't exist in the database schema }) logger.info('Document created successfully', { document_id: document.id, title: document.title }) return { document, content_analysis: contentAnalysis, message: `Document "${document.title}" created successfully` } })
  • Zod schema used for validating and parsing the input arguments in the create_document handler.
    const CreateDocumentSchema = z.object({ project_id: z.string().uuid().optional(), title: z.string().min(1).max(500), content: z.string(), document_type: z.enum(['requirement', 'design', 'technical', 'meeting_notes', 'other']), metadata: z.record(z.any()).optional() })
  • MCPTool object defining the 'create_document' tool, including its name, description, and detailed inputSchema for the MCP protocol.
    export const createDocumentTool: MCPTool = { name: 'create_document', description: 'Create a new document with markdown content and optional frontmatter metadata', inputSchema: { type: 'object', properties: { project_id: { type: 'string', format: 'uuid', description: 'Project ID to associate the document with (required)' }, title: { type: 'string', minLength: 1, maxLength: 500, description: 'The title of the document' }, content: { type: 'string', description: 'The markdown content of the document (can include YAML frontmatter)' }, document_type: { type: 'string', enum: ['requirement', 'design', 'technical', 'meeting_notes', 'other'], description: 'The type of document being created' }, metadata: { type: 'object', description: 'Additional metadata for the document' } }, required: ['title', 'content', 'document_type', 'project_id'] } }
  • Exported handlers object that maps tool names to their handler functions, including 'create_document' to createDocument. Used by other modules to invoke the tool.
    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 }

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