Skip to main content
Glama

populate_diataxis_content

Automatically populate Diataxis documentation with project-specific content using repository analysis to create tailored technical documentation.

Instructions

Intelligently populate Diataxis documentation with project-specific content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysisIdYesRepository analysis ID from analyze_repository tool
docsPathYesPath to documentation directory
populationLevelNocomprehensive
includeProjectSpecificNo
preserveExistingNo
technologyFocusNoSpecific technologies to emphasize

Implementation Reference

  • Core handler logic in ContentPopulationEngine that orchestrates Diataxis content population: retrieves analysis, loads memory insights, generates content plan, creates content for each category (tutorials, how-tos, reference, explanation), writes files, updates navigation, and returns results.
    async populateContent(
      options: PopulationOptions,
      context?: any,
    ): Promise<PopulationResult> {
      // Report initial progress
      if (context?.meta?.progressToken) {
        await context.meta.reportProgress?.({ progress: 0, total: 100 });
      }
    
      await context?.info?.("πŸ“ Starting Diataxis content population...");
    
      // 1. Retrieve and validate repository analysis
      await context?.info?.("πŸ“Š Retrieving repository analysis...");
      const analysis = await this.getRepositoryAnalysis(options.analysisId);
    
      if (context?.meta?.progressToken) {
        await context.meta.reportProgress?.({ progress: 20, total: 100 });
      }
    
      // 2. Get memory-enhanced insights for intelligent content generation
      await context?.info?.(
        "🧠 Loading memory insights for intelligent generation...",
      );
      await this.loadMemoryInsights(analysis, options);
    
      if (context?.meta?.progressToken) {
        await context.meta.reportProgress?.({ progress: 40, total: 100 });
      }
    
      // 3. Generate content plan based on project characteristics AND memory insights
      await context?.info?.("πŸ—ΊοΈ Generating intelligent content plan...");
      const contentPlan = await this.generateIntelligentContentPlan(
        analysis,
        options.populationLevel,
        this.memoryInsights,
      );
    
      // 4. Generate memory-informed content for each Diataxis category
      const tutorials = await this.generateMemoryInformedTutorialContent(
        contentPlan.tutorials,
        analysis,
        this.memoryInsights,
      );
      const howTos = await this.generateMemoryInformedHowToContent(
        contentPlan.howToGuides,
        analysis,
        this.memoryInsights,
      );
      const reference = await this.generateMemoryInformedReferenceContent(
        contentPlan.reference,
        analysis,
        this.memoryInsights,
      );
      const explanation = await this.generateMemoryInformedExplanationContent(
        contentPlan.explanation,
        analysis,
        this.memoryInsights,
      );
    
      // 5. Write content to documentation structure
      const filesCreated = await this.writeContentToStructure(
        options.docsPath,
        { tutorials, howTos, reference, explanation },
        options.preserveExisting,
      );
    
      // 6. Generate cross-references and navigation updates
      await context?.info?.("πŸ”— Generating cross-references and navigation...");
      await this.updateNavigationAndCrossReferences(
        options.docsPath,
        contentPlan,
      );
    
      if (context?.meta?.progressToken) {
        await context.meta.reportProgress?.({ progress: 100, total: 100 });
      }
    
      await context?.info?.(
        `βœ… Content population complete! Generated ${filesCreated} file(s)`,
      );
    
      return {
        success: true,
        filesCreated,
        contentPlan,
        populationMetrics: this.calculatePopulationMetrics(
          filesCreated,
          contentPlan,
        ),
        nextSteps: this.generateMemoryInformedNextSteps(
          analysis,
          contentPlan,
          this.memoryInsights,
        ),
      };
    }
  • MCP Tool registration exporting the tool definition with name, description, input schema, and implicitly the handler.
    export const populateDiataxisContent: Tool = {
      name: "populate_diataxis_content",
      description:
        "Intelligently populate Diataxis documentation with project-specific content",
      inputSchema: {
        type: "object",
        properties: {
          analysisId: {
            type: "string",
            description: "Repository analysis ID from analyze_repository tool",
          },
          docsPath: {
            type: "string",
            description: "Path to documentation directory",
          },
          populationLevel: {
            type: "string",
            enum: ["basic", "comprehensive", "intelligent"],
            default: "comprehensive",
            description: "Level of content generation detail",
          },
          includeProjectSpecific: {
            type: "boolean",
            default: true,
            description: "Generate project-specific examples and code",
          },
          preserveExisting: {
            type: "boolean",
            default: true,
            description: "Preserve any existing content",
          },
          technologyFocus: {
            type: "array",
            items: { type: "string" },
            description: "Specific technologies to emphasize in content",
          },
        },
        required: ["analysisId", "docsPath"],
      },
    };
  • Input schema defining parameters for the tool: analysisId (required), docsPath (required), populationLevel, includeProjectSpecific, preserveExisting, technologyFocus.
    inputSchema: {
      type: "object",
      properties: {
        analysisId: {
          type: "string",
          description: "Repository analysis ID from analyze_repository tool",
        },
        docsPath: {
          type: "string",
          description: "Path to documentation directory",
        },
        populationLevel: {
          type: "string",
          enum: ["basic", "comprehensive", "intelligent"],
          default: "comprehensive",
          description: "Level of content generation detail",
        },
        includeProjectSpecific: {
          type: "boolean",
          default: true,
          description: "Generate project-specific examples and code",
        },
        preserveExisting: {
          type: "boolean",
          default: true,
          description: "Preserve any existing content",
        },
        technologyFocus: {
          type: "array",
          items: { type: "string" },
          description: "Specific technologies to emphasize in content",
        },
      },
      required: ["analysisId", "docsPath"],
    },
  • Top-level exported handler function that instantiates ContentPopulationEngine and delegates to its populateContent method.
    export async function handlePopulateDiataxisContent(
      args: any,
      context?: any,
    ): Promise<PopulationResult> {
      const engine = new ContentPopulationEngine();
      return await engine.populateContent(args, context);
    }

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/tosin2013/documcp'

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