Skip to main content
Glama

configure_theme

Customize UI theme settings including colors, mode, typography, and border radius for its-just-ui React components.

Instructions

Configure theme settings including colors, mode, and typography

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo
colorsNo
borderRadiusNo
fontFamilyNo

Implementation Reference

  • Main handler function configureTheme that generates and returns theme configuration code based on the input config object.
    export const themeTools = {
      configureTheme(config: ThemeConfig): string {
        const { mode, colors, borderRadius, fontFamily } = config;
    
        let themeCode = `import { ThemeProvider } from 'its-just-ui';
    import 'its-just-ui/styles.css';
    
    const customTheme = {`;
    
        if (colors) {
          themeCode += `
      colors: {${Object.entries(colors)
        .map(
          ([key, value]) => `
        ${key}: '${value}'`,
        )
        .join(",")}
      },`;
        }
    
        if (borderRadius) {
          themeCode += `
      borderRadius: '${borderRadius}',`;
        }
    
        if (fontFamily) {
          themeCode += `
      fontFamily: '${fontFamily}',`;
        }
    
        themeCode += `
    };
    
    export default function App() {
      return (
        <ThemeProvider ${mode ? `mode="${mode}"` : ""} theme={customTheme}>
          {/* Your app content */}
        </ThemeProvider>
      );
    }`;
    
        return themeCode;
      },
  • Zod schema defining the input structure for the configure_theme tool, matching the ThemeConfig interface.
    const ConfigureThemeSchema = z.object({
      mode: z.enum(["light", "dark", "system"]).optional(),
      colors: z
        .object({
          primary: z.string().optional(),
          secondary: z.string().optional(),
          success: z.string().optional(),
          warning: z.string().optional(),
          error: z.string().optional(),
          info: z.string().optional(),
        })
        .optional(),
      borderRadius: z.string().optional(),
      fontFamily: z.string().optional(),
    });
  • src/index.ts:209-231 (registration)
    Tool registration in the list_tools response, defining name, description, and inputSchema.
      name: "configure_theme",
      description:
        "Configure theme settings including colors, mode, and typography",
      inputSchema: {
        type: "object",
        properties: {
          mode: { type: "string", enum: ["light", "dark", "system"] },
          colors: {
            type: "object",
            properties: {
              primary: { type: "string" },
              secondary: { type: "string" },
              success: { type: "string" },
              warning: { type: "string" },
              error: { type: "string" },
              info: { type: "string" },
            },
          },
          borderRadius: { type: "string" },
          fontFamily: { type: "string" },
        },
      },
    },
  • MCP call_tool handler that parses arguments using the schema and delegates to themeTools.configureTheme.
    case "configure_theme": {
      const config = ConfigureThemeSchema.parse(args);
      const themeCode = themeTools.configureTheme(config);
      return {
        content: [
          {
            type: "text",
            text: themeCode,
          },
        ],
      };
  • TypeScript interface ThemeConfig used in the handler function signature, matching the Zod schema.
    export interface ThemeConfig {
      mode?: "light" | "dark" | "system";
      colors?: {
        primary?: string;
        secondary?: string;
        success?: string;
        warning?: string;
        error?: string;
        info?: string;
      };
      borderRadius?: string;
      fontFamily?: string;
    }
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. 'Configure' implies a mutation/write operation, but the description doesn't state whether this requires specific permissions, whether changes are reversible, what happens to existing settings not mentioned, or what the response looks like. For a mutation tool with zero annotation coverage, this is inadequate.

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 purpose. Every word earns its place by specifying what's being configured. There's no fluff or redundancy, making it appropriately sized for the tool's scope.

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 (4 parameters with nested objects, no output schema, and no annotations), the description is incomplete. It doesn't cover behavioral aspects like mutation effects, doesn't fully explain parameters, and provides no usage context. For a configuration tool with multiple parameters, this leaves significant gaps for an AI agent.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'colors, mode, and typography', which partially maps to parameters (mode, colors, fontFamily), but misses 'borderRadius' entirely and doesn't explain what 'typography' means (fontFamily only). It doesn't clarify parameter formats (e.g., color strings as hex codes) or the nested structure of 'colors'. With 4 parameters and low coverage, this adds minimal 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 'configure' and the resource 'theme settings', and specifies the aspects being configured (colors, mode, typography). It distinguishes this tool from siblings like 'check_accessibility' or 'generate_component' by focusing on theme configuration rather than accessibility checking or component generation. However, it doesn't explicitly differentiate from potential theme-related siblings (none are listed), so it's not a perfect 5.

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, when this tool is appropriate versus other configuration methods, or any exclusions. With siblings like 'create_form' and 'generate_component' that might involve theme aspects, the lack of differentiation is a significant gap.

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/its-just-ui/its-just-mcp'

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