Skip to main content
Glama

docs_generate_structure

Create documentation scaffold and initial structure for projects using Docusaurus, MkDocs, or Sphinx frameworks based on project analysis.

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 primary handler function for the "docs_generate_structure" tool. It parses arguments, resolves paths, 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, specifying parameters like projectPath, framework (enum), template, and outputPath.
    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:57-83 (registration)
    Registration of the "docs_generate_structure" tool in the tools array, including name, description, and schema.
    { 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)
    Dispatch case in the CallToolRequestSchema handler that routes calls to the generateStructure function.
    case "docs_generate_structure": return await generateStructure(args);
  • Helper function that generates setup instructions for Docusaurus 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/LiL-Loco/documentation-mcp-server'

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