Skip to main content
Glama

docs_generate_structure

Create documentation scaffold and configuration files by analyzing project code to establish initial structure for 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

  • Main handler function for the 'docs_generate_structure' tool. Parses arguments, resolves paths, and delegates 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}`); } }
  • Tool schema definition including name, description, and input schema for validation.
    { 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)
    Switch case registration in the CallToolRequest handler that invokes the generateStructure function.
    case "docs_generate_structure": return await generateStructure(args);
  • Helper function to generate Docusaurus-specific setup instructions and structure.
    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/LiL-Loco/documentation-mcp-server'

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