Skip to main content
Glama
bsmi021

Node Omnibus MCP Server

by bsmi021

create_documentation

Generate project documentation for Node.js projects, including READMEs, API references, or component details, using specified directory paths and documentation types with the Node Omnibus MCP Server tool.

Instructions

Generate project documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoComponent or API name for specific documentation
pathYesProject directory path
typeYesDocumentation type

Implementation Reference

  • Main handler function for the 'create_documentation' tool. Validates path, generates content based on type ('readme', 'api', 'component'), writes to appropriate MD file, stores in memory, and returns success message.
    private async handleCreateDocumentation(args: CreateDocumentationArgs) { await this.validatePath(args.path); try { let content = ''; let fileName = ''; switch (args.type) { case 'readme': content = await this.generateProjectDocumentation(args.path); fileName = 'README.md'; break; case 'api': content = await this.generateApiDocumentation(args.path); fileName = 'API.md'; break; case 'component': if (!args.name) { throw new McpError(ErrorCode.InvalidParams, 'Component name is required for component documentation'); } content = await this.generateComponentDoc(args.path, args.name); fileName = `${args.name}.md`; break; } const docPath = path.join(args.path, fileName); await fs.writeFile(docPath, content); // Store in memory for resource access this.projectDocs.set(path.basename(args.path), content); return { content: [ { type: 'text', text: `Documentation created successfully at ${docPath}`, }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to create documentation: ${error instanceof Error ? error.message : String(error)}` ); } }
  • TypeScript interface defining the input arguments for the create_documentation tool.
    interface CreateDocumentationArgs extends Record<string, unknown> { path: string; type: 'readme' | 'api' | 'component'; name?: string; }
  • src/index.ts:365-387 (registration)
    Tool registration in the ListTools response, including name, description, and JSON inputSchema.
    { name: 'create_documentation', description: 'Generate project documentation', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Project directory path', }, type: { type: 'string', enum: ['readme', 'api', 'component'], description: 'Documentation type', }, name: { type: 'string', description: 'Component or API name for specific documentation', }, }, required: ['path', 'type'], }, },
  • src/index.ts:407-408 (registration)
    Switch case in CallToolRequest handler that dispatches to the create_documentation handler.
    case 'create_documentation': return await this.handleCreateDocumentation(args as CreateDocumentationArgs);
  • Helper function to generate README-style project documentation from package.json.
    private async generateProjectDocumentation(projectPath: string): Promise<string> { const packageJson = JSON.parse( await fs.readFile(path.join(projectPath, 'package.json'), 'utf-8') ); return `# ${packageJson.name} ## Description ${packageJson.description || 'A Node.js project'} ## Installation \`\`\`bash npm install \`\`\` ## Scripts ${Object.entries(packageJson.scripts || {}) .map(([name, command]) => `- \`npm run ${name}\`: ${command}`) .join('\n')} ## Dependencies ${Object.entries(packageJson.dependencies || {}) .map(([name, version]) => `- \`${name}\`: ${version}`) .join('\n')} ## Dev Dependencies ${Object.entries(packageJson.devDependencies || {}) .map(([name, version]) => `- \`${name}\`: ${version}`) .join('\n')} `; }

Other Tools

Related 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/bsmi021/mcp-node-omnibus-server'

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