Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

update_device_value

Manually update a sensor or device value by providing its IDX or name. Set integer (nvalue) or string (svalue) values to control smart home devices.

Instructions

Update a sensor/device value manually. nvalue is integer value, svalue is string value. Provide IDX or Name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idxNo
nameNo
nvalueNo
svalueNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'update_device_value' tool. An MCP tool that updates a sensor/device value manually by calling the Domoticz JSON API with param=udevice. It accepts idx (int), name (str), nvalue (int, default 0), and svalue (str, default ''). It resolves the device by idx or name, then makes a GET request to the Domoticz API.
    async def update_device_value(idx: int | None = None, name: str | None = None, nvalue: int = 0, svalue: str = "") -> str:
        """Update a sensor/device value manually. nvalue is integer value, svalue is string value. Provide IDX or 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=udevice&idx={resolved_idx}&nvalue={nvalue}&svalue={urllib.parse.quote(svalue)}")
            return response.text
  • The tool registration using the @mcp.tool() decorator on line 1063, immediately preceding the update_device_value function.
    @mcp.tool()
    async def update_device_value(idx: int | None = None, name: str | None = None, nvalue: int = 0, svalue: str = "") -> str:
  • The type hints and docstring for the tool define its schema: idx (int|None), name (str|None), nvalue (int, default 0), svalue (str, default ''). The docstring describes the purpose and parameters.
    async def update_device_value(idx: int | None = None, name: str | None = None, nvalue: int = 0, svalue: str = "") -> str:
        """Update a sensor/device value manually. nvalue is integer value, svalue is string value. Provide IDX or Name."""
Behavior2/5

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

No annotations provided, so description carries full burden. It discloses it's a write operation but does not mention side effects, permissions, device-specific behaviors, or triggering of actions. Insufficient for safe/accurate invocation.

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?

Extremely concise with two sentences, front-loaded with key action and parameters. Lacks structure but efficient; could expand slightly without losing conciseness.

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?

Missing details on output schema, error cases, relationship between nvalue/svalue, and prerequisites. For a mutation tool with no annotations, description is incomplete for reliable use.

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?

Description adds semantics beyond schema by explaining 'nvalue' is integer and 'svalue' is string, and that IDX or Name identifies device. However, it does not explain when to use both values or behavior if both IDX and Name are provided. Schema coverage is 0%, so description partially compensates.

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?

Description clearly states it updates a sensor/device value manually, with specific verb 'update' and resource 'sensor/device value'. It distinguishes from siblings by implying manual setting of raw values, though not explicitly.

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 versus siblings like 'set_switch_state' or 'set_dimmer_level'. Only hints at manual value update and provides identification method (IDX or Name), but lacks context for appropriate 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