Skip to main content
Glama

docs_generate_structure

Create initial documentation structure and configuration files for projects using Docusaurus, MkDocs, or Sphinx frameworks.

Instructions

Generate documentation scaffold/structure based on project analysis. Creates initial directory structure and configuration files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project directory
frameworkYesDocumentation framework to use
templateNoTemplate to use (for Docusaurus: classic, facebook, etc.)
outputPathNoOutput path for documentation (default: ./docs)

Implementation Reference

  • The main handler function for the 'docs_generate_structure' tool. It parses arguments and dispatches to framework-specific generators (Docusaurus, MkDocs, Sphinx).
    export async function generateStructure(args: any) { const { projectPath, framework, template, outputPath = "docs" } = args as GenerateStructureArgs; try { const fullOutputPath = path.resolve(projectPath, outputPath); switch (framework) { case "docusaurus": return await generateDocusaurus(projectPath, fullOutputPath, template); case "mkdocs": return await generateMkDocs(projectPath, fullOutputPath); case "sphinx": return await generateSphinx(projectPath, fullOutputPath); default: throw new Error(`Unsupported framework: ${framework}`); } } catch (error) { throw new Error(`Failed to generate structure: ${error}`); } }
  • Input schema definition for the 'docs_generate_structure' tool, including properties and requirements.
    { name: "docs_generate_structure", description: "Generate documentation scaffold/structure based on project analysis. Creates initial directory structure and configuration files.", inputSchema: { type: "object", properties: { projectPath: { type: "string", description: "Path to the project directory", }, framework: { type: "string", description: "Documentation framework to use", enum: ["docusaurus", "mkdocs", "sphinx"], }, template: { type: "string", description: "Template to use (for Docusaurus: classic, facebook, etc.)", }, outputPath: { type: "string", description: "Output path for documentation (default: ./docs)", }, }, required: ["projectPath", "framework"], }, },
  • src/index.ts:302-303 (registration)
    Tool handler registration in the switch statement for CallToolRequestSchema.
    case "docs_generate_structure": return await generateStructure(args);
  • Helper function generating setup instructions for Docusaurus documentation framework.
    async function generateDocusaurus(projectPath: string, outputPath: string, template?: string) { const availableTemplates = [ "classic", "facebook", "meta", ]; const selectedTemplate = template && availableTemplates.includes(template) ? template : "classic"; const message = `📦 Docusaurus Setup Instructions: 1. Install Docusaurus: cd ${projectPath} npx create-docusaurus@latest ${path.basename(outputPath)} ${selectedTemplate} --typescript 2. Available templates: ${availableTemplates.map(t => `- ${t}`).join("\n ")} 3. Start the development server: cd ${path.basename(outputPath)} npm start 4. Build for production: npm run build The static files will be in the 'build' directory, ready for hosting!`; return { content: [ { type: "text", text: message, }, ], }; }

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