Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

set_temperature_setpoint

Set a thermostat's target temperature to a specified Celsius setpoint. Provide the temperature value and optionally the device index or name.

Instructions

Set the temperature setpoint for a thermostat.

Args: setpoint: Target temperature in Celsius (e.g., 21.5). idx: Device index. name: Device name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
setpointYes
idxNo
nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `set_temperature_setpoint` tool handler function. It accepts a `setpoint` (float, Celsius), optional `idx` or `name`, resolves the device index, and sends a request to the Domoticz API with param=setsetpoint to set the thermostat temperature.
    @mcp.tool()
    async def set_temperature_setpoint(setpoint: float, idx: int | None = None, name: str | None = None) -> str:
        """Set the temperature setpoint for a thermostat.
        
        Args:
            setpoint: Target temperature in Celsius (e.g., 21.5).
            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=setsetpoint&idx={resolved_idx}&setpoint={setpoint}")
            return response.text
  • The tool is registered with MCP via the `@mcp.tool()` decorator on the `set_temperature_setpoint` function. No separate registration file exists; the decorator registers it automatically.
    @mcp.tool()
    async def set_temperature_setpoint(setpoint: float, idx: int | None = None, name: str | None = None) -> str:
  • The input schema is defined by the function signature and docstring: `setpoint` (float, required), `idx` (int, optional), `name` (str, optional). The docstring describes the parameters.
    """Set the temperature setpoint for a thermostat.
    
    Args:
        setpoint: Target temperature in Celsius (e.g., 21.5).
        idx: Device index.
        name: Device name.
    """
  • `_resolve_device_idx` is the helper function used by `set_temperature_setpoint` to resolve a device name or idx to its numeric idx for the API call.
    async def _resolve_device_idx(client: "httpx.AsyncClient", idx: Optional[int] = None, name: Optional[str] = None) -> Optional[int]:
        """Resolve a device to its idx."""
        return await _resolve_idx(client, idx, name, _device_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getdevices&filter=all&used=true")
  • The generic `_resolve_idx` helper used by `_resolve_device_idx` to look up an entity by name in cached device data.
    async def _resolve_idx(
        client: "httpx.AsyncClient",
        idx: Optional[int],
        name: Optional[str],
        cache: Dict[str, Any],
        api_url: str
    ) -> Optional[int]:
        """Resolve an entity to its idx by either using the provided idx or looking up by name."""
        if idx is not None:
            return idx
        if not name:
            return None
        items = await _get_cached_data(client, cache, api_url)
        for item in items:
            if item.get("Name", "").lower() == name.lower():
                return int(str(item.get("idx")))
        return None
Behavior2/5

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

With no annotations provided, the description should carry the full burden of behavioral disclosure. It only states that it sets a temperature setpoint, implying a write operation, but does not mention authorization requirements, side effects, or what happens on success/failure. The presence of an output schema partially mitigates this, but the description adds no behavioral context beyond the action itself.

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 and uses an 'Args:' section for structured parameter info. It is front-loaded with the purpose. Minor room for improvement: it could be even more compact without losing clarity.

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 (3 parameters, 1 required) and the lack of annotations, the description adequately covers parameters but misses broader context like when to use idx vs name, what happens if both are null, or range restrictions for setpoint. The presence of an output schema helps cover return values, but the description alone is not fully complete.

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?

The input schema has no descriptions (0% schema_description_coverage), but the tool description compensates by explaining all three parameters: setpoint as 'Target temperature in Celsius', idx as 'Device index', and name as 'Device name'. The example for setpoint adds clarity. However, it doesn't explain how idx and name are used for device identification or that they are optional.

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 that the tool sets the temperature setpoint for a thermostat, specifying the verb 'set' and the resource 'temperature setpoint'. The example value for setpoint clarifies usage. The name itself distinguishes from sibling tools like set_color_brightness or 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 is provided on when to use this tool versus alternatives (e.g., other device control tools). There is no mention of prerequisites, such as the need to specify idx or name to identify the device, or 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