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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'intelligently populate' but doesn't clarify what this entails operationally—whether it modifies files, requires specific permissions, handles errors, or has side effects. This is inadequate for a tool with 6 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core functionality without unnecessary words. Every part contributes to understanding the tool's purpose, making it appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no annotations, no output schema), the description is insufficient. It lacks details on behavior, output, error handling, and how it integrates with sibling tools like 'analyze_repository'. This leaves significant gaps for an AI agent to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, and the description adds no parameter-specific details beyond the tool's general purpose. It implies parameters like 'analysisId' and 'docsPath' are used but doesn't explain their roles or interactions. Baseline 3 is appropriate as the schema partially documents parameters, but the description doesn't compensate for gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('populate') and target ('Diataxis documentation'), and specifies the content type ('project-specific'). However, it doesn't differentiate from sibling tools like 'generate_contextual_content' or 'update_existing_documentation', which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives is provided. The description mentions 'intelligently populate' but doesn't specify prerequisites, appropriate contexts, or exclusions compared to other documentation tools in the server.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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