Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

set_color_brightness

Set hue (0-360) and brightness (0-100) for RGB lights, with optional white mode on supported hardware.

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 handler function for the 'set_color_brightness' tool. It sets color (hue 0-360) and brightness (0-100) for an RGB light device via Domoticz 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
  • The docstring serves as the schema definition for the tool, describing the parameters: hue (int 0-360), brightness (int 0-100), idx (optional int), name (optional str), iswhite (optional bool).
    @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).
  • The tool is registered via the @mcp.tool() decorator on the async function, which registers it with the FastMCP instance.
    @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 carries full burden. It discloses that iswhite enables white mode on supported hardware, but does not mention side effects, mutability, persistence, or whether the update is reversible. The behavioral model is unclear.

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 with a bulleted parameter list. It is front-loaded and contains no unnecessary words.

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?

With 5 parameters, no output schema, and no annotations, the description adequately explains the primary function but lacks details on error handling, preconditions, or return value. It meets minimum viability.

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 0% schema description coverage, the description adds value by specifying ranges for hue (0-360) and brightness (0-100) and explaining iswhite. However, it does not clarify how idx and name relate for device identification, or that one may be required.

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 it sets color and brightness for an RGB light, distinguishing it from siblings like set_color_temperature (color temperature) and set_dimmer_level (brightness only). The verb 'set' and resource 'color and brightness' are specific.

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 such as set_color_temperature, set_dimmer_level, or set_switch_state. It does not mention exclusions or prerequisites.

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