Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

set_color_temperature

Adjust a light's color temperature in Domoticz by specifying a kelvin value from 0 (warm) to 100 (cold).

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 handler function. It is decorated with @mcp.tool(), takes 'kelvin' (0-100), 'idx', and 'name' parameters, resolves the device by idx/name, and calls the Domoticz API 'setkelvinlevel' endpoint.
    @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
  • Input schema/definition embedded in the function signature and docstring: kelvin (int, 0-100), idx (optional int), name (optional str). Also referenced in agent_guidance prompt at line 533.
    @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.
        """
  • Tool registration via the @mcp.tool() decorator on the async function 'set_color_temperature'. The FastMCP instance 'mcp' is created at line 70.
    @mcp.tool()
Behavior2/5

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

No annotations provided. The description discloses the kelvin value scale (0 warm, 100 cold) but omits behavioral traits such as error behavior, what happens if the device is off, or if the change is reversible.

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 short and front-loaded with a clear action sentence followed by a parameter list. No unnecessary information, though slightly sparse.

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?

With 3 parameters and no enums, the description does not cover sufficient context for a call that modifies device state. It lacks error scenarios, device requirements, or behavior when parameters are mismatched. Output schema exists, so return format is covered.

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 crucial meaning for kelvin (range and mapping). However, idx and name are only listed with no added context beyond what the schema indicates (they are device identifiers).

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 tool sets color temperature for a light. It distinguishes from siblings like set_color_brightness and set_dimmer_level by focusing on temperature, though it does not explicitly differentiate from set_temperature_setpoint (likely for thermostats).

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 explicit guidance on when to use this tool versus alternatives. It lacks prerequisites (e.g., device must support color temperature) and does not mention when not to use it.

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