Skip to main content
Glama

webforge_get_palette_details

Retrieve complete color details for a specific palette, including all colors in the palette, to support website design decisions.

Instructions

Get complete details for a specific color palette including all colors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
palette_idYesPalette ID (e.g., "P01", "P02")

Implementation Reference

  • The getPaletteDetails function implements the core logic for webforge_get_palette_details. It validates the palette_id parameter, queries the Supabase database for the design_palettes table, and returns formatted palette details including colors, typography, and border radius.
    export async function getPaletteDetails(paletteId: string): Promise<PaletteDetailsResponse> {
      try {
        if (!paletteId) {
          throw new Error('Palette ID is required');
        }
    
        const client = supabase.getAnonClient();
        
        const { data, error } = await client
          .from('design_palettes')
          .select('*')
          .eq('id', paletteId)
          .single();
    
        if (error) {
          if (error.code === 'PGRST116') {
            throw new Error(`Palette with ID '${paletteId}' not found`);
          }
          supabase.log(`Error fetching palette details: ${error.message}`, 'error');
          throw new Error(`Failed to fetch palette details: ${error.message}`);
        }
    
        if (!data) {
          throw new Error(`Palette with ID '${paletteId}' not found`);
        }
    
        const palette = data as DesignPalette;
    
        supabase.log(`Retrieved details for palette: ${palette.name}`);
    
        return {
          id: palette.id,
          name: palette.name,
          category: palette.category,
          mood: palette.mood || [],
          industries: palette.industries || [],
          colors: {
            primaryLight: palette.primary_light,
            primaryDark: palette.primary_dark,
            accentLight: palette.accent_light
          },
          typography: {
            heading: palette.heading_font,
            body: palette.body_font
          },
          borderRadius: palette.border_radius
        };
    
      } catch (error) {
        supabase.log(`Error in getPaletteDetails: ${error}`, 'error');
        throw error;
      }
    }
  • PaletteDetailsResponse interface defines the output schema for the webforge_get_palette_details tool, specifying the structure of palette details returned including id, name, category, mood, industries, colors, typography, and borderRadius.
    export interface PaletteDetailsResponse {
      id: string;
      name: string;
      category: string;
      mood: string[];
      industries: string[];
      colors: {
        primaryLight: string;
        primaryDark: string;
        accentLight: string;
      };
      typography: {
        heading: string;
        body: string;
      };
      borderRadius: string;
    }
  • DesignPalette interface defines the database model for palettes, matching the Supabase table schema with fields for palette metadata and styling properties.
    export interface DesignPalette {
      id: string;
      name: string;
      mood: string[];
      industries: string[];
      category: string;
      primary_light: string;
      primary_dark: string;
      accent_light: string;
      heading_font: string;
      body_font: string;
      border_radius: string;
      created_at?: string;
    }
  • src/index.ts:88-102 (registration)
    Tool schema registration for webforge_get_palette_details in the MCP server, defining the tool's name, description, and input schema requiring a palette_id parameter.
    {
      name: 'webforge_get_palette_details',
      description: 'Get complete details for a specific color palette including all colors',
      inputSchema: {
        type: 'object',
        properties: {
          palette_id: {
            type: 'string',
            description: 'Palette ID (e.g., "P01", "P02")',
          },
        },
        required: ['palette_id'],
        additionalProperties: false,
      },
    },
  • src/index.ts:287-298 (registration)
    Tool handler registration in the switch statement that routes webforge_get_palette_details calls to the getPaletteDetails function, extracts the palette_id argument, and returns the result as JSON.
    case 'webforge_get_palette_details': {
      const { palette_id } = args as { palette_id: string };
      const result = await getPaletteDetails(palette_id);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
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 states it 'gets' details, implying a read-only operation, but doesn't cover aspects like authentication needs, rate limits, error handling, or what 'complete details' entails beyond colors. This leaves gaps in understanding the tool's behavior.

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 key action and resource. It avoids unnecessary words and directly communicates the tool's function without waste.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on usage guidelines, behavioral traits, and output expectations, making it incomplete for optimal agent understanding.

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?

The input schema has 100% description coverage, with the parameter 'palette_id' well-documented in the schema. The description adds no additional meaning beyond implying it's for a 'specific color palette', which aligns with the schema but doesn't provide extra context like format examples or constraints.

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 'Get' and the resource 'complete details for a specific color palette including all colors', making the purpose evident. However, it doesn't explicitly distinguish this tool from its sibling 'webforge_get_style_details' or 'webforge_list_palettes', which slightly limits differentiation.

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?

No guidance is provided on when to use this tool versus alternatives like 'webforge_list_palettes' for listing palettes or 'webforge_get_style_details' for other details. The description implies usage for a specific palette but lacks explicit context or exclusions.

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/joytorm/webforge-mcp'

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