Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_rooms

Retrieve all room plans from your Domoticz home automation system to manage smart home configurations.

Instructions

Get all rooms (Room Plans) from Domoticz.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'get_rooms' MCP tool handler. It is decorated with @mcp.tool(), calls _get_cached_data to fetch room plans from Domoticz API (param=getplans), and returns the result 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})
  • The @mcp.tool() decorator on line 679 registers 'get_rooms' as an MCP tool with the FastMCP server instance.
    @mcp.tool()
  • The _get_cached_data helper function that get_rooms relies on to fetch and cache the room plans data from the Domoticz API.
    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 _plans_cache global variable used by get_rooms and related functions to cache room plans data (TTL: 300 seconds).
    _plans_cache = {"data": None, "timestamp": 0}
  • The get_rooms_resource() - a parallel MCP resource handler at 'domoticz://rooms' that provides the same room plans data, using identical logic to the get_rooms tool.
    @mcp.resource("domoticz://rooms")
    async def get_rooms_resource() -> str:
        """Read the list of all Domoticz rooms (Room Plans)."""
        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})
Behavior2/5

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

No annotations provided, and the description is minimal. It does not disclose behavioral traits such as read-only nature, permissions required, or any side effects. A simple data retrieval tool, but still opaque.

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?

The description is a single, clear sentence that gets straight to the point with no unnecessary words. Ideal conciseness for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and an output schema present, the description is nearly complete. It could optionally mention the return type or use case, but it suffices for a straightforward list retrieval.

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?

No parameters exist, so the schema fully covers the input. The description correctly implies no input needed. Baseline 3 is elevated because the description perfectly aligns with the empty schema and requires no additional parameter explanation.

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 verb 'Get' and the resource 'all rooms (Room Plans) from Domoticz', which is specific and distinguishes it from sibling tools like get_all_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 (e.g., get_room_devices). No hints about prerequisites 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