Skip to main content
Glama

Color Palette Generator

generate_color_palette

Create color palettes from descriptions, moods, industries, or hex colors. Get hex/RGB/HSL values, WCAG accessibility scores, and CSS custom properties for design projects.

Instructions

Generate a color palette from a description, mood, industry, or hex seed color. Accepts moods (calm, energetic, luxurious), industries (fintech, healthcare, fashion), nature themes (sunset, ocean, forest), or a specific hex color. Returns hex/RGB/HSL values, WCAG accessibility scores, and CSS custom properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesDescription of the desired palette (e.g. 'calm fintech blue', 'sunset', '#3B82F6')
countNoNumber of colors (2-10)
formatNoColor format in outputall
includeShadesNoInclude light/dark shades for each color

Implementation Reference

  • The primary handler function that processes the tool input and executes the color palette generation logic.
    async function handler(input: Input) {
      const { description, count, format, includeShades } = input;
    
      const palette = findBestPalette(description);
    
      // Select `count` colors from seeds (cycle if needed)
      const selected: string[] = [];
      for (let i = 0; i < count; i++) {
        selected.push(palette.seeds[i % palette.seeds.length]);
      }
    
      const colors = selected.map((hex, i) => ({
        index: i + 1,
        name: `Color ${i + 1}`,
        ...formatColor(hex, format),
        ...(includeShades && { shades: generateShades(hex) }),
      }));
    
      // CSS custom properties
      const cssVars = selected.map((hex, i) => `  --color-${i + 1}: ${hex};`).join("\n");
    
      return {
        paletteName: palette.name,
        paletteLabel: palette.label,
        colors,
        css: `:root {\n${cssVars}\n}`,
        swatches: selected.join(", "),
      };
    }
  • Input schema definition for the color palette generator tool.
    const inputSchema = z.object({
      description: z
        .string()
        .min(1)
        .max(500)
        .describe("Description of the desired palette. E.g. 'sunset over the ocean', 'corporate fintech', 'playful children's brand', '#3B82F6'"),
      count: z
        .number()
        .int()
        .min(2)
        .max(10)
        .default(5)
        .describe("Number of colors to generate (2-10)"),
      format: z
        .enum(["hex", "rgb", "hsl", "all"])
        .default("all")
        .describe("Output color format"),
      includeShades: z
        .boolean()
        .default(false)
        .describe("Include light/dark shades for each color"),
    });
  • Tool registration for 'color-palette'. Note that 'generate_color_palette' in the server index maps to this underlying tool.
    const colorPaletteTool: ToolDefinition<Input> = {
      name: "color-palette",
      description:
        "Generate a color palette from a description or seed color. Supports moods (calm, energetic, luxurious), industries (fintech, healthcare, fashion), nature themes (sunset, ocean, forest), and hex color seeds. Returns hex, RGB, HSL values with WCAG accessibility scores and CSS variables.",
      version: "1.0.0",
      inputSchema,
      handler,
      metadata: {
        tags: ["color", "palette", "design", "branding", "css", "accessibility"],
        pricing: "$0.0005 per call",
        exampleInput: {
          description: "calm ocean fintech brand",
          count: 5,
          format: "all",
          includeShades: false,
        },
      },
    };
    
    registerTool(colorPaletteTool);
Behavior4/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 effectively compensates by detailing the output format (hex/RGB/HSL, WCAG accessibility scores, CSS custom properties), which is crucial given the absence of an output schema. It does not mention side effects or determinism.

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?

Two well-structured sentences with zero waste: the first covers all input modalities with examples, the second covers all output formats. Information is front-loaded and dense.

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

Completeness4/5

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

Given the lack of output schema and annotations, the description adequately covers both input semantics and output structure (WCAG scores, CSS properties). For a 4-parameter generation tool, this provides sufficient context for invocation, though mentioning determinism or rate limits would improve it further.

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?

Despite 100% schema coverage (baseline 3), the description adds significant semantic value by providing concrete examples of description parameter inputs (moods like 'calm', industries like 'fintech', nature themes like 'sunset'), helping the agent construct valid prompts beyond the schema's generic 'Description of the desired palette'.

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 generates color palettes and specifies input types (moods, industries, hex codes) with concrete examples. However, it does not explicitly distinguish itself from the sibling tool 'generate_brand_kit', which may also involve color generation.

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

Usage Guidelines3/5

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

The description provides rich examples of valid inputs (e.g., 'calm fintech blue', 'sunset', '#3B82F6') implying when to use the tool, but lacks explicit guidance on when NOT to use it or when to prefer alternatives like 'generate_brand_kit'.

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/marras0914/agent-toolbelt'

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