Skip to main content
Glama
CarbonoDev

TailwindCSS MCP Server

by CarbonoDev

generate_component_template

Create HTML component templates with TailwindCSS classes for buttons, cards, forms, and other UI elements. Choose from minimal, modern, or playful styles with optional dark mode and responsive design support.

Instructions

Generate HTML component templates with TailwindCSS classes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentTypeYesType of component to generate (e.g., 'button', 'card', 'form', 'navbar', 'modal', 'alert', 'badge', 'breadcrumb')
styleNoVisual style of the component (default: modern)
darkModeNoInclude dark mode support (default: false)
responsiveNoInclude responsive design classes (default: true)

Implementation Reference

  • The primary implementation of the generateComponentTemplate method that orchestrates the generation process.
    async generateComponentTemplate(params: GenerateTemplateParams): Promise<ComponentTemplate> {
      try {
        const { componentType, style = 'modern', darkMode = false, responsive = true } = params;
        
        const generator = this.componentTemplates.get(componentType.toLowerCase());
        if (!generator) {
          throw new ServiceError(
            `Unsupported component type: ${componentType}`,
            'TemplateService',
            'generateComponentTemplate'
          );
        }
    
        return generator(style, darkMode, responsive);
  • The handler function in index.ts that receives the tool request and calls the service.
    private async handleGenerateComponentTemplate(args: any): Promise<any> {
      try {
        const params = this.validateGenerateTemplateParams(args);
        const template = await this.templateService.generateComponentTemplate(params);
        return this.createSuccessResponse(template);
      } catch (error) {
        this.handleServiceError(error, "Failed to generate component template");
      }
    }
  • src/index.ts:241-265 (registration)
    Registration of the generate_component_template tool within the MCP tool list.
    name: "generate_component_template",
    description: "Generate HTML component templates with TailwindCSS classes",
    inputSchema: {
      type: "object",
      properties: {
        componentType: {
          type: "string",
          description: "Type of component to generate (e.g., 'button', 'card', 'form', 'navbar', 'modal', 'alert', 'badge', 'breadcrumb')",
        },
        style: {
          type: "string",
          enum: ["minimal", "modern", "playful"],
          description: "Visual style of the component (default: modern)",
        },
        darkMode: {
          type: "boolean",
          description: "Include dark mode support (default: false)",
        },
        responsive: {
          type: "boolean",
          description: "Include responsive design classes (default: true)",
        },
      },
      required: ["componentType"],
    },
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 tool generates templates but doesn't cover aspects like whether it's a read-only operation, if it requires authentication, rate limits, or what the output looks like (e.g., HTML code). This leaves significant gaps for a tool that likely produces code.

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 directly states the tool's purpose without any fluff. It's front-loaded and appropriately sized, making it easy to parse quickly.

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 code templates, lack of annotations, and no output schema, the description is incomplete. It doesn't explain the output format, potential errors, or behavioral traits, which are crucial for an agent to use this tool effectively in development contexts.

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 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond implying TailwindCSS usage, which is already clear from the tool name and schema. Thus, it meets the baseline for high schema coverage without compensating value.

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 verb 'generate' and the resource 'HTML component templates with TailwindCSS classes', making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'convert_css_to_tailwind' or 'generate_color_palette', which also generate outputs but for different purposes, so it misses full sibling distinction.

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, typical use cases, or compare to siblings like 'get_tailwind_utilities' or 'search_tailwind_docs', leaving the agent with no context for selection.

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/CarbonoDev/tailwindcss-mcp-server'

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