Skip to main content
Glama

docs_create_page

Create or edit documentation pages using Markdown content for multi-language projects. Specify page path, title, and content to generate professional 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

  • The handler function that executes the tool: resolves the full path, creates directories if needed, formats Markdown content with frontmatter and title, writes the 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}`); } }
  • Input schema definition for the docs_create_page tool, specifying parameters and validation.
    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"], },
  • src/index.ts:84-109 (registration)
    Tool registration in the tools array, including name, description, and schema.
    { 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"], }, },
  • src/index.ts:304-305 (registration)
    Switch case that registers the handler dispatch for tool calls to docs_create_page.
    case "docs_create_page": return await createPage(args);
  • TypeScript interface matching the input schema for type safety in the handler.
    interface CreatePageArgs { docsPath: string; pagePath: string; title: string; content: string; }

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