Skip to main content
Glama
kaeljune

Fibaro HC3 MCP Server

by kaeljune

fibaro_control_rgb_light

Control RGB lights on Fibaro HC3: turn on/off, set color, and adjust brightness in a single command for unified lighting management.

Instructions

Complete control for RGB lights: turn on/off, set color, and brightness in one command. Use this when user wants to control multiple aspects of an RGB light at once (e.g., "turn on light 5 red color at 50% brightness").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDevice ID
actionYesTurn light on or off
color_nameNoColor name (e.g., "red", "green", "blue", "xanh lá", "tím")
brightnessNoBrightness level (0-100), optional

Implementation Reference

  • The handler for the fibaro_control_rgb_light tool. It handles turning the device on/off, setting RGB color from color name using getColorRGB, and adjusting brightness, composing multiple operations into one tool call.
    case 'fibaro_control_rgb_light': {
      if (!this.fibaroClient) {
        throw new Error('Not connected to Fibaro HC3. Please check your configuration and restart the MCP server.');
      }
      const deviceId = args?.id as number;
      const action = args?.action as string;
      const colorName = args?.color_name as string;
      const brightness = args?.brightness as number;
    
      const results = [];
    
      // First, turn on/off the light
      if (action === 'on') {
        await this.fibaroClient.turnOnDevice(deviceId);
        results.push(`Turned on device ${deviceId}`);
      } else if (action === 'off') {
        await this.fibaroClient.turnOffDevice(deviceId);
        results.push(`Turned off device ${deviceId}`);
      }
    
      // Set color if specified
      if (colorName && action === 'on') {
        const rgb = getColorRGB(colorName);
        await this.fibaroClient.setColor(deviceId, rgb.r, rgb.g, rgb.b, 0);
        results.push(`Set color to ${colorName} RGB(${rgb.r},${rgb.g},${rgb.b})`);
      }
    
      // Set brightness if specified
      if (brightness !== undefined && action === 'on') {
        await this.fibaroClient.setBrightness(deviceId, brightness);
        results.push(`Set brightness to ${brightness}%`);
      }
    
      return {
        content: [
          {
            type: 'text',
            text: `Device ${deviceId}: ${results.join(', ')}`,
          },
        ],
      };
    }
  • Input schema defining parameters for the fibaro_control_rgb_light tool: device id (required), action (on/off required), optional color_name and brightness.
    inputSchema: {
      type: 'object',
      properties: {
        id: {
          type: 'number',
          description: 'Device ID',
        },
        action: {
          type: 'string',
          enum: ['on', 'off'],
          description: 'Turn light on or off',
        },
        color_name: {
          type: 'string',
          description: 'Color name (e.g., "red", "green", "blue", "xanh lá", "tím")',
        },
        brightness: {
          type: 'number',
          description: 'Brightness level (0-100), optional',
          minimum: 0,
          maximum: 100,
        },
      },
      required: ['id', 'action'],
    },
  • src/index.ts:272-300 (registration)
    Registration of the fibaro_control_rgb_light tool in the ListTools response, including name, description, and input schema.
    {
      name: 'fibaro_control_rgb_light',
      description: 'Complete control for RGB lights: turn on/off, set color, and brightness in one command. Use this when user wants to control multiple aspects of an RGB light at once (e.g., "turn on light 5 red color at 50% brightness").',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'number',
            description: 'Device ID',
          },
          action: {
            type: 'string',
            enum: ['on', 'off'],
            description: 'Turn light on or off',
          },
          color_name: {
            type: 'string',
            description: 'Color name (e.g., "red", "green", "blue", "xanh lá", "tím")',
          },
          brightness: {
            type: 'number',
            description: 'Brightness level (0-100), optional',
            minimum: 0,
            maximum: 100,
          },
        },
        required: ['id', 'action'],
      },
    },
  • Supporting utility function that converts color names (including Vietnamese) to RGB values, used in the tool handler for color setting.
    function getColorRGB(colorName: string): { r: number; g: number; b: number } {
      const colors: { [key: string]: { r: number; g: number; b: number } } = {
        'red': { r: 255, g: 0, b: 0 },
        'green': { r: 0, g: 255, b: 0 },
        'blue': { r: 0, g: 0, b: 255 },
        'yellow': { r: 255, g: 255, b: 0 },
        'purple': { r: 128, g: 0, b: 128 },
        'pink': { r: 255, g: 192, b: 203 },
        'orange': { r: 255, g: 165, b: 0 },
        'cyan': { r: 0, g: 255, b: 255 },
        'magenta': { r: 255, g: 0, b: 255 },
        'white': { r: 255, g: 255, b: 255 },
        'black': { r: 0, g: 0, b: 0 },
        'lime': { r: 50, g: 205, b: 50 },
        'violet': { r: 238, g: 130, b: 238 },
        // Vietnamese color names
        'đỏ': { r: 255, g: 0, b: 0 },
        'xanh lá': { r: 0, g: 255, b: 0 },
        'xanh dương': { r: 0, g: 0, b: 255 },
        'vàng': { r: 255, g: 255, b: 0 },
        'tím': { r: 128, g: 0, b: 128 },
        'hồng': { r: 255, g: 192, b: 203 },
        'cam': { r: 255, g: 165, b: 0 },
        'trắng': { r: 255, g: 255, b: 255 },
        'đen': { r: 0, g: 0, b: 0 }
      };
      
      const normalizedName = colorName.toLowerCase().trim();
      return colors[normalizedName] || { r: 255, g: 255, b: 255 }; // default to white
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the tool's capabilities but lacks behavioral details like required permissions, error handling, rate limits, or what happens if optional parameters are omitted. The description doesn't contradict annotations, but it's insufficient for a mutation tool with no annotation coverage.

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 concise and front-loaded, with two sentences that efficiently convey purpose and usage guidelines without any wasted words. Every sentence adds clear value to the tool's understanding.

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 complexity (mutation with 4 parameters) and lack of annotations or output schema, the description is incomplete. It covers purpose and usage well but misses critical behavioral context like side effects or response format, leaving gaps for an AI agent to operate safely.

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 minimal value by implying that parameters can be combined in one command but doesn't provide additional syntax or format details beyond what the schema already specifies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('turn on/off, set color, and brightness') and resource ('RGB lights'), distinguishing it from siblings like fibaro_set_brightness or fibaro_set_color by emphasizing multi-aspect control in one command.

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

Usage Guidelines5/5

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

It explicitly states when to use this tool ('when user wants to control multiple aspects of an RGB light at once') and provides an example, effectively distinguishing it from single-function siblings without mentioning when not to use it, which is sufficient given the clear context.

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/kaeljune/fibaro-mcp-server'

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