Skip to main content
Glama
bsmi021

Node Omnibus MCP Server

by bsmi021

create_documentation

Generate project documentation for Node.js applications, including README files, API documentation, and component documentation based on specified paths and types.

Instructions

Generate project documentation

Input Schema

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

Implementation Reference

  • The main handler function implementing the create_documentation tool. It validates the path, generates documentation content based on the specified type (readme, api, or component), writes it to a file, stores it in memory, and returns a 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)}`
            );
        }
    }
  • src/index.ts:365-387 (registration)
    Tool registration in the ListToolsRequestSchema response, defining the name, description, and JSON input schema for the create_documentation tool.
    {
        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'],
        },
    },
  • TypeScript interface defining the shape of arguments for the create_documentation handler.
    interface CreateDocumentationArgs extends Record<string, unknown> {
        path: string;
        type: 'readme' | 'api' | 'component';
        name?: string;
    }
  • src/index.ts:407-408 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes calls to the create_documentation handler function.
    case 'create_documentation':
        return await this.handleCreateDocumentation(args as CreateDocumentationArgs);
  • Helper function that generates README-style project documentation by reading and formatting the package.json file.
        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')}
    `;
        }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Generate project documentation' implies a write operation that creates files, but it doesn't specify what gets created (e.g., file names, locations), whether it overwrites existing files, what permissions are needed, or what the output looks like. This leaves significant behavioral questions unanswered.

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 phrase that gets straight to the point with zero wasted words. It's appropriately sized for a tool with three parameters and good schema documentation, making it easy to parse quickly.

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?

For a tool that creates documentation files (implied mutation) with no annotations and no output schema, the description is insufficient. It doesn't explain what gets generated, where files are placed, what format they're in, or what happens on success/failure. The high schema coverage helps with parameters, but the overall context for using this tool remains incomplete.

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?

The schema has 100% description coverage, with all three parameters clearly documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema (path, type with enum values, name). This meets the baseline of 3 when schema coverage is high.

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 'Generate project documentation' clearly states the verb ('generate') and resource ('project documentation'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential siblings like 'create_type_definition' or 'generate_component' that might also involve documentation creation, preventing 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. With siblings like 'create_type_definition' and 'generate_component' that might overlap in documentation-related functionality, there's no indication of when this tool is appropriate versus those others, nor any prerequisites or exclusions mentioned.

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

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