Skip to main content
Glama
CarbonoDev

TailwindCSS MCP Server

by CarbonoDev

generate_color_palette

Create custom color palettes with multiple shades from a base color for TailwindCSS projects. Input a base color and name to generate consistent shading scales.

Instructions

Generate a custom color palette with multiple shades from a base color

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseColorYesBase color in hex, rgb, or hsl format (e.g., '#3B82F6', 'rgb(59, 130, 246)')
nameYesName for the color palette (e.g., 'brand', 'accent')
shadesNoArray of shade values to generate (default: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950])

Implementation Reference

  • The core business logic that generates the color palette using base colors and shade generation utilities.
    async generateColorPalette(params: GeneratePaletteParams): Promise<ColorPalette> {
      try {
        const { baseColor, name, shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] } = params;
        
        if (!this.isValidColor(baseColor)) {
          throw new ServiceError(
            `Invalid color format: ${baseColor}. Use hex, rgb, or hsl format.`,
            'TemplateService',
            'generateColorPalette'
          );
        }
    
        const colors = this.generateColorShades(baseColor, shades);
        const cssVariables = this.generateCSSVariables(name, colors);
        const tailwindConfig = this.generateTailwindColorConfig(name, colors);
    
        return {
          name,
          colors,
          cssVariables,
          tailwindConfig
        };
  • The MCP handler method in the main server class that validates request arguments and calls the template service.
    private async handleGenerateColorPalette(args: any): Promise<any> {
      try {
        const params = this.validateGeneratePaletteParams(args);
        const palette = await this.templateService.generateColorPalette(params);
        return this.createSuccessResponse(palette);
      } catch (error) {
        this.handleServiceError(error, "Failed to generate color palette");
      }
    }
  • src/index.ts:218-235 (registration)
    The MCP tool definition for 'generate_color_palette' in the server registration block.
    name: "generate_color_palette",
    description: "Generate a custom color palette with multiple shades from a base color",
    inputSchema: {
      type: "object",
      properties: {
        baseColor: {
          type: "string",
          description: "Base color in hex, rgb, or hsl format (e.g., '#3B82F6', 'rgb(59, 130, 246)')",
        },
        name: {
          type: "string",
          description: "Name for the color palette (e.g., 'brand', 'accent')",
        },
        shades: {
          type: "array",
          items: { type: "number" },
          description: "Array of shade values to generate (default: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950])",
        },
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 mentions generating a palette but does not specify output format (e.g., JSON, array), whether the operation is idempotent, potential rate limits, or error conditions. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior beyond the basic action.

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 unnecessary words or fluff. It is front-loaded with the core action, making it easy to parse and understand quickly, which is ideal for conciseness.

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 lack of annotations and output schema, the description is incomplete for effective tool use. It does not explain what the output looks like (e.g., format, structure), potential side effects, or error handling, which are critical for an AI agent to invoke the tool correctly without additional context.

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 input schema fully documents all parameters (baseColor, name, shades) with clear descriptions. The description adds minimal value beyond the schema, as it only reiterates the concept of generating shades from a base color without providing additional semantic context or examples not already covered.

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 resource ('custom color palette with multiple shades from a base color'), making the purpose immediately understandable. However, it does not explicitly differentiate this tool from sibling tools like 'get_tailwind_colors', which might also involve color retrieval or generation, leaving some ambiguity about when to choose one over the other.

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, such as 'get_tailwind_colors' or 'convert_css_to_tailwind'. It lacks context about prerequisites, typical use cases, or any exclusions, leaving the agent to infer usage based solely on the tool name and description without explicit direction.

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