Skip to main content
Glama

generate_config

Create configuration files for static site generators like Jekyll, Hugo, Docusaurus, MkDocs, or Eleventy to streamline project setup.

Instructions

Generate configuration files for the selected static site generator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ssgYes
projectNameYes
projectDescriptionNo
outputPathYesWhere to generate config files

Implementation Reference

  • Main handler function for 'generate_config' tool. Validates input with Zod schema, generates SSG-specific configuration files using helper functions, writes them to outputPath, and formats MCP response.
    export async function generateConfig(
      args: unknown,
    ): Promise<{ content: any[] }> {
      const startTime = Date.now();
      const { ssg, projectName, projectDescription, outputPath } =
        inputSchema.parse(args);
    
      try {
        // Ensure output directory exists
        await fs.mkdir(outputPath, { recursive: true });
    
        let configFiles: Array<{ path: string; content: string }> = [];
    
        switch (ssg) {
          case "docusaurus":
            configFiles = await generateDocusaurusConfig(
              projectName,
              projectDescription || "",
            );
            break;
          case "mkdocs":
            configFiles = await generateMkDocsConfig(
              projectName,
              projectDescription || "",
            );
            break;
          case "hugo":
            configFiles = await generateHugoConfig(
              projectName,
              projectDescription || "",
            );
            break;
          case "jekyll":
            configFiles = await generateJekyllConfig(
              projectName,
              projectDescription || "",
            );
            break;
          case "eleventy":
            configFiles = await generateEleventyConfig(
              projectName,
              projectDescription || "",
            );
            break;
        }
    
        // Write all config files
        for (const file of configFiles) {
          const filePath = path.join(outputPath, file.path);
          await fs.mkdir(path.dirname(filePath), { recursive: true });
          await fs.writeFile(filePath, file.content);
        }
    
        const configResult = {
          ssg,
          projectName,
          projectDescription,
          outputPath,
          filesCreated: configFiles.map((f) => f.path),
          totalFiles: configFiles.length,
        };
    
        const response: MCPToolResponse<typeof configResult> = {
          success: true,
          data: configResult,
          metadata: {
            toolVersion: "1.0.0",
            executionTime: Date.now() - startTime,
            timestamp: new Date().toISOString(),
          },
          recommendations: [
            {
              type: "info",
              title: "Configuration Complete",
              description: `Generated ${configFiles.length} configuration files for ${ssg}`,
            },
          ],
          nextSteps: [
            {
              action: "Setup Documentation Structure",
              toolRequired: "setup_structure",
              description: `Create Diataxis-compliant documentation structure`,
              priority: "high",
            },
          ],
        };
    
        return formatMCPResponse(response);
      } catch (error) {
        const errorResponse: MCPToolResponse = {
          success: false,
          error: {
            code: "CONFIG_GENERATION_FAILED",
            message: `Failed to generate config: ${error}`,
            resolution: "Ensure output path is writable and SSG type is supported",
          },
          metadata: {
            toolVersion: "1.0.0",
            executionTime: Date.now() - startTime,
            timestamp: new Date().toISOString(),
          },
        };
        return formatMCPResponse(errorResponse);
      }
    }
  • Zod input schema defining parameters for SSG type, project details, and output path.
    const inputSchema = z.object({
      ssg: z.enum(["jekyll", "hugo", "docusaurus", "mkdocs", "eleventy"]),
      projectName: z.string(),
      projectDescription: z.string().optional(),
      outputPath: z.string(),
    });
  • Helper functions like generateDocusaurusConfig, generateMkDocsConfig, etc., that return arrays of {path, content} for specific SSG configurations.
    }
    
    async function generateDocusaurusConfig(
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('generate configuration files') but doesn't describe what this entails: e.g., whether it creates new files, overwrites existing ones, requires specific permissions, or has side effects like modifying project structure. For a tool that likely writes files, this is a significant gap in transparency.

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, clear sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficient, with every word contributing to understanding the core function. No fluff or redundancy is present.

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 (a tool that generates files likely involving write operations), lack of annotations, no output schema, and low schema description coverage, the description is incomplete. It doesn't address behavioral aspects, parameter meanings, or output details, making it inadequate for safe and effective use by an AI agent.

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

Parameters2/5

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

Schema description coverage is low (25%), with only one parameter ('outputPath') having a description. The tool description doesn't add any semantic details about parameters like 'ssg', 'projectName', or 'projectDescription' beyond what the schema provides (e.g., enum values for 'ssg'). It fails to compensate for the coverage gap, leaving most parameters minimally documented.

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 tool's purpose: 'Generate configuration files for the selected static site generator.' It specifies the verb ('generate') and resource ('configuration files'), and the scope ('for the selected static site generator') is reasonably clear. However, it doesn't explicitly differentiate from sibling tools like 'recommend_ssg' or 'setup_structure', which might have overlapping functionality, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, and with many sibling tools (e.g., 'recommend_ssg', 'setup_structure'), there's no indication of how this tool fits into a workflow. This lack of usage context leaves the agent to guess based on the name alone.

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