Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

update_device_value

Update a sensor or device value in Domoticz by specifying its IDX or name, along with integer and string values.

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/tool function for 'update_device_value'. It resolves the device by idx or name, then updates the device value via Domoticz API (udevice command) with nvalue (integer) and svalue (string) parameters.
    @mcp.tool()
    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
  • Registration of the tool via the @mcp.tool() decorator on FastMCP instance, which registers it as an MCP tool named 'update_device_value'.
    @mcp.tool()
    async def update_device_value(idx: int | None = None, name: str | None = None, nvalue: int = 0, svalue: str = "") -> str:
  • Input schema/parameters for the tool: idx (optional device index), name (optional device name), nvalue (integer value, default 0), svalue (string value, default empty). At least one of idx or name must be provided.
    async def update_device_value(idx: int | None = None, name: str | None = None, nvalue: int = 0, svalue: str = "") -> str:
  • Helper function used by the handler to resolve a device idx from either an explicit idx or a device name lookup.
    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")
Behavior2/5

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

Without annotations, description only indicates mutation ('update') but omits details on side effects, required permissions, idempotency, or return behavior.

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?

Two sentences with no verbosity, front-loading purpose; however, lacks additional detail that could be included without sacrificing 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?

Despite having output schema, the description fails to cover usage guidelines, behavioral traits, and parameter semantics, leaving significant gaps for an agent to correctly invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has no descriptions; description adds minimal clarity by restating types ('nvalue is integer value') and stating to provide IDX or Name, but does not explain what IDX/Name represent or the relationship between parameters.

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?

Clearly states the action 'update' and resource 'sensor/device value manually', distinguishing it from sibling tools like update_event and update_user_variable by specifying the target resource.

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 alternatives; only mentions parameter requirements but no context on selection criteria or exclusions.

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