Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

set_color_brightness

Set the color and brightness of an RGB light using hue (0-360) and brightness (0-100) values. Optionally enable white mode or specify device by index or name.

Instructions

Set color and brightness for an RGB light.

Args: hue: Color hue (0-360). brightness: Brightness level (0-100). idx: Device index. name: Device name. iswhite: Set to True for white mode (on supported hardware).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hueYes
brightnessYes
idxNo
nameNo
iswhiteNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the set_color_brightness MCP tool. Sets color hue and brightness for an RGB light by calling the Domoticz 'setcolbrightnessvalue' API.
    @mcp.tool()
    async def set_color_brightness(hue: int, brightness: int, idx: int | None = None, name: str | None = None, iswhite: bool = False) -> str:
        """Set color and brightness for an RGB light.
        
        Args:
            hue: Color hue (0-360).
            brightness: Brightness level (0-100).
            idx: Device index.
            name: Device name.
            iswhite: Set to True for white mode (on supported hardware).
        """
        if idx is None and name is None:
            return '{"status": "error", "message": "Must provide either idx or name"}'
        async with create_client() as client:
            resolved_idx = await _resolve_device_idx(client, idx, name)
            if resolved_idx is None:
                return '{"status": "error", "message": "Device not found"}'
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=setcolbrightnessvalue&idx={resolved_idx}&hue={hue}&brightness={brightness}&iswhite={str(iswhite).lower()}")
            return response.text
  • Input schema/parameters for set_color_brightness: hue (int 0-360), brightness (int 0-100), optional idx/name for device lookup, and optional iswhite flag.
    Args:
        hue: Color hue (0-360).
        brightness: Brightness level (0-100).
        idx: Device index.
        name: Device name.
        iswhite: Set to True for white mode (on supported hardware).
    """
    if idx is None and name is None:
        return '{"status": "error", "message": "Must provide either idx or name"}'
    async with create_client() as client:
        resolved_idx = await _resolve_device_idx(client, idx, name)
  • Registration of the tool via the @mcp.tool() decorator on the FastMCP instance, making it available as an MCP tool named 'set_color_brightness'.
    @mcp.tool()
    async def set_color_brightness(hue: int, brightness: int, idx: int | None = None, name: str | None = None, iswhite: bool = False) -> str:
Behavior2/5

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

With no annotations, the description must cover behavioral traits. It explains 'iswhite' mode but fails to disclose how device selection works (e.g., if both idx and name are null, does it fail?), side effects, or permissions. This leaves significant ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a clear purpose sentence upfront followed by parameter list. It avoids unnecessary text, though the parameter descriptions could be more streamlined.

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 (5 parameters, device selection ambiguity) and no annotations, the description fails to adequately explain device identification logic. An output schema exists, so return values are covered, but operational context is lacking.

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 0%, so the description adds necessary meaning: ranges for hue (0-360) and brightness (0-100), and explanations for idx, name, and iswhite. However, it does not clarify how idx and name relate or if one is required, providing only partial compensation.

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 'Set color and brightness for an RGB light,' providing a specific verb and resource. It effectively distinguishes this tool from siblings like set_color_temperature and set_dimmer_level.

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 does not explicitly state when to use this tool versus alternatives like set_color_temperature or set_switch_state. The context is implied by the name and description, but no exclusions or alternative recommendations are provided.

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/adrighem/domoticz-mcp'

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