Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

delete_device

Delete or hide a Domoticz device by specifying its IDX or name.

Instructions

Delete (or hide) a device by IDX or Name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idxNo
nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `delete_device` tool handler function. It accepts idx or name, resolves the device ID, sends a 'setused&used=false' request to Domoticz to delete/hide the device, invalidates the device cache, and returns the response.
    @mcp.tool()
    async def delete_device(idx: int | None = None, name: str | None = None) -> str:
        """Delete (or hide) a device by 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=setused&used=false&idx={resolved_idx}")
            _device_cache["timestamp"] = 0 # Invalidate cache
            return response.text
  • The `@mcp.tool()` decorator on line 972 registers `delete_device` as an MCP tool on the FastMCP server instance.
    @mcp.tool()
    async def delete_device(idx: int | None = None, name: str | None = None) -> str:
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'delete or hide' without clarifying the difference or impact. Does not disclose whether the action is reversible, what happens to related data, or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words, but it is too terse and omits crucial details. Conciseness is positive, but not at the expense of clarity.

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?

Given the lack of annotations and 0% schema coverage, the description should provide more context. It does not explain what 'hide' means, success/failure indicators, or edge cases. An output schema exists but doesn't compensate for missing behavioral info.

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 description coverage is 0%, meaning the description adds no detail about the 'idx' and 'name' parameters beyond their existence. The text mentions 'by IDX or Name' but does not explain their semantics, required formats, or which takes precedence.

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 the action ('Delete or hide'), the resource ('device'), and the identification method ('by IDX or Name'). It effectively distinguishes this tool from siblings like rename_device and search_devices.

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 delete vs hide, or when to prefer idx over name. No context about prerequisites or exclusions. The description lacks explicit usage direction.

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