Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_rooms

Retrieve a list of all rooms and room plans from your Domoticz home automation system.

Instructions

Get all rooms (Room Plans) from Domoticz.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler function 'get_rooms' decorated with @mcp.tool(). It fetches room plans from the Domoticz API using cached data and returns them as JSON.
    @mcp.tool()
    async def get_rooms() -> str:
        """Get all rooms (Room Plans) from Domoticz."""
        async with create_client() as client:
            plans = await _get_cached_data(client, _plans_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getplans&order=name&used=true")
            return json.dumps({"status": "OK", "result": plans})
  • Helper function '_get_cached_data' used to fetch and cache data from the Domoticz API. Used by get_rooms to retrieve plans with caching (5 min TTL).
    async def _get_cached_data(client: "httpx.AsyncClient", cache_obj: Dict[str, Any], api_url: str, key_path: str = "result") -> List[Dict[str, Any]]:
        now = time.time()
        if cache_obj["data"] is None or (now - cache_obj["timestamp"]) > CACHE_TTL:
            response = await _do_request(client, "GET", api_url)
            cache_obj["data"] = response.json().get(key_path, [])
            cache_obj["timestamp"] = now
        return cache_obj["data"]
  • The FastMCP server instance. The get_rooms function is registered as an MCP tool via the @mcp.tool() decorator on line 685.
    mcp = FastMCP("Domoticz", transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False), stateless_http=True)
  • The cache variable '_plans_cache' used by get_rooms (and get_rooms_resource) to cache room plans data to avoid redundant API calls.
    _plans_cache = {"data": None, "timestamp": 0}
Behavior2/5

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

No annotations provided, and description only says 'Get all rooms'. No disclosure of behavioral traits such as rate limits, data freshness, or potential overhead. For a tool with no annotations, this is insufficient.

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

Conciseness5/5

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

Single sentence with no extraneous content. Perfectly concise and front-loaded.

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?

Has output schema, so return values are probably documented. However, description lacks sufficient context for an agent to distinguish from similar list tools (e.g., get_all_devices, get_scenes). Adequate but not 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?

Input schema has zero parameters and is fully covered. The description adds no param info, but baseline for 0 params is 4. No further detail needed.

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?

Clearly states it retrieves all rooms (Room Plans) from Domoticz. The verb 'Get' and resource are specific, but lacks differentiation from sibling tools like 'get_room_devices' or 'get_scenes'.

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. Minimal description omits context like prerequisites or typical use cases.

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