Skip to main content
Glama
ricleedo

MCP Server Boilerplate

by ricleedo

make-html-page

Generate HTML pages with GPT-5 and save them to specified file paths for web development projects.

Instructions

Generate an HTML page using GPT-5 and save it to a file path

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that uses OpenAI's GPT-5 to generate HTML content based on the provided description, ensures the directory exists, writes the HTML to the specified file path, and returns a success message.
      async ({ description, filePath }) => {
        if (!process.env.OPENAI_API_KEY) {
          throw new Error("OPENAI_API_KEY environment variable is required");
        }
    
        const openai = createOpenAI({
          apiKey: process.env.OPENAI_API_KEY,
        });
    
        const { text } = await generateText({
          model: openai("gpt-5"),
          prompt: `
    Generate complete, valid HTML code for a 1080x720pxwebpage based on this description: 
    
    ${description}
    
    Return ONLY the HTML code, no explanations or markdown formatting. The HTML should be complete and ready to save as a .html file.`,
        });
    
        const dir = dirname(filePath);
        mkdirSync(dir, { recursive: true });
    
        writeFileSync(filePath, text, "utf8");
    
        return {
          content: [
            {
              type: "text",
              text: `Success: HTML page generated and saved to ${filePath}`,
            },
          ],
        };
      }
  • Zod schema defining the input parameters: 'description' (string) for the HTML page details and 'filePath' (string) for the output location.
    {
      description: z
        .string()
        .describe("A detailed description of the HTML page to generate"),
      filePath: z
        .string()
        .describe("Absolute file path where the HTML should be saved"),
    },
  • src/index.ts:16-60 (registration)
    Registration of the 'make-html-page' tool using McpServer.tool(), including name, description, input schema, and inline handler function.
    server.tool(
      "make-html-page",
      "Generate an HTML page using GPT-5 and save it to a file path",
      {
        description: z
          .string()
          .describe("A detailed description of the HTML page to generate"),
        filePath: z
          .string()
          .describe("Absolute file path where the HTML should be saved"),
      },
      async ({ description, filePath }) => {
        if (!process.env.OPENAI_API_KEY) {
          throw new Error("OPENAI_API_KEY environment variable is required");
        }
    
        const openai = createOpenAI({
          apiKey: process.env.OPENAI_API_KEY,
        });
    
        const { text } = await generateText({
          model: openai("gpt-5"),
          prompt: `
    Generate complete, valid HTML code for a 1080x720pxwebpage based on this description: 
    
    ${description}
    
    Return ONLY the HTML code, no explanations or markdown formatting. The HTML should be complete and ready to save as a .html file.`,
        });
    
        const dir = dirname(filePath);
        mkdirSync(dir, { recursive: true });
    
        writeFileSync(filePath, text, "utf8");
    
        return {
          content: [
            {
              type: "text",
              text: `Success: HTML page generated and saved to ${filePath}`,
            },
          ],
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool 'generate[s] an HTML page using GPT-5 and save[s] it to a file path', which implies it performs write operations and uses AI, but lacks details on permissions, error handling, rate limits, or what the 'save' entails (e.g., overwriting files). This is insufficient for a tool with potential side effects.

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 any wasted words. It directly states the action and outcome, making it highly concise and well-structured.

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 of generating and saving files with AI, the description is incomplete. It lacks annotations, has no output schema, and doesn't explain behavioral aspects like how the HTML is generated, file path requirements, or error cases. This leaves significant gaps for an AI agent to understand the tool's full context.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description does not mention any parameters, which is appropriate here since none exist. A baseline of 4 is applied as it correctly avoids redundant information, though it doesn't add value beyond the schema.

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 with specific verbs ('generate', 'save') and resources ('HTML page', 'file path'), and mentions the use of 'GPT-5'. However, since there are no sibling tools, the lack of differentiation doesn't reduce the score from the maximum clarity for its standalone purpose.

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, prerequisites, or constraints. It merely states what the tool does without context for its application, which is a significant gap in usage guidance.

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/ricleedo/html-maker-mcp'

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