Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

set_color_temperature

Adjusts a light's color temperature using a 0-100 scale where 0 is warmest and 100 is coldest. Specify the device by its index or name.

Instructions

Set color temperature for a light.

Args: kelvin: Color temperature level (0-100). Note: 0 is warmest, 100 is coldest (standard Domoticz range). idx: Device index. name: Device name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kelvinYes
idxNo
nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `set_color_temperature` tool function. It is decorated with @mcp.tool(), takes 'kelvin' (0-100), 'idx', and 'name' parameters, resolves the device idx, and calls the Domoticz API with 'setkelvinlevel'.
    @mcp.tool()
    async def set_color_temperature(kelvin: int, idx: int | None = None, name: str | None = None) -> str:
        """Set color temperature for a light.
        
        Args:
            kelvin: Color temperature level (0-100). Note: 0 is warmest, 100 is coldest (standard Domoticz range).
            idx: Device index.
            name: Device name.
        """
        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=setkelvinlevel&idx={resolved_idx}&kelvin={kelvin}")
            return response.text
  • The tool is registered via the @mcp.tool() decorator on line 941.
    @mcp.tool()
  • The agent_guidance prompt notes that color temperature uses a 0-100 range (0=warmest, 100=coldest), providing context for the tool's usage.
       - Dimmers and Dimmer levels: Always 0 to 100. (0=Off, 100=Full).
       - Color Temperature (Kelvin): 0 to 100 (Where 0 is warmest/coldest depending on hardware, usually 0=Warm, 100=Cold).
    5. TROUBLESHOOTING: 
       - If a device is "Timed Out" or "Unresponsive", use `get_system_health` and check `domoticz://logs/error`.
       - To find which automation controls a device, use `search_scripts` with the device's name or idx.
    6. USER VARIABLES: Use `get_user_variables` to read state that isn't attached to a physical device.
    """
Behavior2/5

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

No annotations provided, so description carries full burden. It lacks disclosure of potential side effects, validation behavior (e.g., if both idx and name provided), or whether changes are reversible. Only basic operation is described.

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?

Description is concise with an 'Args:' structure, no redundant information. Could be slightly more terse or front-loaded, but overall efficient.

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?

Output schema exists, so return values are covered. However, optional parameters (idx, name) lack explanation of when to use. Sibling tools are present but no differentiation. Without annotations, description is minimally complete.

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%, but description adds meaning: kelvin is color temperature with 0-100 range and warm/cold mapping. However, idx and name are only labeled as 'Device index' and 'Device name' without further context on required scenarios.

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?

Description clearly states 'Set color temperature for a light' with specific verb and resource. It also explains the kelvin scale (0 warmest, 100 coldest). Among siblings, it is distinct from set_color_brightness 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 Guidelines2/5

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

No guidance on when to use this tool vs alternatives like set_color_brightness or set_switch_state. Missing context like prerequisites (e.g., light must support color temperature) or when not to use.

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