Skip to main content
Glama
ThaLoc0one

Documentation MCP Server

by ThaLoc0one

docs_create_page

Create or edit individual documentation pages with Markdown content, specifying path, title, and content for multi-language project documentation.

Instructions

Create or edit individual documentation pages with Markdown content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docsPathYesPath to documentation directory
pagePathYesRelative path for the page (e.g., 'guides/getting-started.md')
titleYesPage title
contentYesMarkdown content for the page

Implementation Reference

  • src/index.ts:85-108 (registration)
    Tool schema definition for docs_create_page registered in the tools array with input validation schema (docsPath, pagePath, title, content) and required fields.
    name: "docs_create_page",
    description: "Create or edit individual documentation pages with Markdown content",
    inputSchema: {
      type: "object",
      properties: {
        docsPath: {
          type: "string",
          description: "Path to documentation directory",
        },
        pagePath: {
          type: "string",
          description: "Relative path for the page (e.g., 'guides/getting-started.md')",
        },
        title: {
          type: "string",
          description: "Page title",
        },
        content: {
          type: "string",
          description: "Markdown content for the page",
        },
      },
      required: ["docsPath", "pagePath", "title", "content"],
    },
  • Core handler function that creates a Markdown documentation page: creates directories recursively, formats content with YAML frontmatter (title), writes to file, and returns success message.
    export async function createPage(args: any) {
      const { docsPath, pagePath, title, content } = args as CreatePageArgs;
    
      try {
        const fullPath = path.resolve(docsPath, pagePath);
        const dir = path.dirname(fullPath);
    
        await fs.mkdir(dir, { recursive: true });
    
        const formattedContent = `---
    title: ${title}
    ---
    
    # ${title}
    
    ${content}
    `;
    
        await fs.writeFile(fullPath, formattedContent, "utf-8");
    
        return {
          content: [
            {
              type: "text",
              text: `✅ Page created successfully at: ${fullPath}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to create page: ${error}`);
      }
    }
  • TypeScript interface defining the expected arguments for createPage: docsPath, pagePath, title, and content (all required strings).
    interface CreatePageArgs {
      docsPath: string;
      pagePath: string;
      title: string;
      content: string;
    }
  • src/index.ts:304-328 (registration)
    Route registration in the CallToolRequestSchema handler that dispatches the "docs_create_page" tool name to the createPage function.
          case "docs_create_page":
            return await createPage(args);
          case "docs_generate_api":
            return await generateApi(args);
          case "docs_build_static":
            return await buildStatic(args);
          case "docs_export_pdf":
            return await exportPdf(args);
          case "docs_preview":
            return await preview(args);
          case "docs_generate_openapi":
            return await generateOpenApi(args);
          case "docs_generate_sales_docs":
            return await generateSalesDocs(args);
          default:
            throw new Error(`Unknown tool: ${name}`);
        }
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: "text", text: `Error: ${errorMessage}` }],
          isError: true,
        };
      }
    });
  • src/index.ts:12-13 (registration)
    Import statement importing the createPage handler from the tools module.
    import { createPage } from "./tools/createPage.js";
    import { generateApi } from "./tools/generateApi.js";
Behavior2/5

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

The description lacks detail on side effects, such as whether it overwrites existing pages, creates intermediate directories, or requires specific permissions. No annotations are provided to compensate, leaving the agent with minimal behavioral insight.

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

Conciseness4/5

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

The description is a single concise sentence that front-loads the core functionality. However, it sacrifices some informative detail for brevity.

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?

With no output schema and only a brief description, the tool's behavior (e.g., return values, editing behavior) is underspecified. The agent lacks complete context to invoke it reliably.

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 coverage is 100%, so the input schema already describes all parameters. The description adds no extra meaning beyond hinting at Markdown content, which schema already specifies. Baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool creates or edits documentation pages with Markdown content, specifying the verb and resource. It distinguishes from sibling tools like docs_analyze_project and docs_generate_api which have different purposes.

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?

No guidance on when to use this tool versus alternatives like docs_generate_api or docs_build_static. The description does not mention context or exclusions.

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/ThaLoc0one/documentation-mcp-server'

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