Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_overview

Retrieve a high-level summary of your Domoticz home automation system, including device counts and optional device samples for more detail.

Instructions

Get a high-level overview of the Domoticz system.

Args: detail_level: 'minimal' (default) for counts and summary, 'standard' for including a sample of devices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detail_levelNominimal

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The get_overview handler function, registered as an MCP tool via @mcp.tool(). It fetches system version, device/scene/variable/plan/hardware counts, and optionally includes a sample of favorite devices when detail_level='standard'.
    @mcp.tool()
    async def get_overview(detail_level: str = "minimal") -> str:
        """Get a high-level overview of the Domoticz system.
        
        Args:
            detail_level: 'minimal' (default) for counts and summary, 'standard' for including a sample of devices.
        """
        async with create_client() as client:
            # Get system info
            resp = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=getversion")
            sys_info = resp.json()
            
            # Get counts from various caches
            devices = await _get_cached_data(client, _device_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getdevices&filter=all&used=true")
            scenes = await _get_cached_data(client, _scene_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getscenes")
            vars = await _get_cached_data(client, _user_variable_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getuservariables")
            plans = await _get_cached_data(client, _plans_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getplans&order=name&used=true")
            
            # Hardware count
            hw_resp = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=gethardware")
            hardware = hw_resp.json().get("result", [])
            
            overview: Dict[str, Any] = {
                "system": {
                    "version": sys_info.get("version"),
                    "build_time": sys_info.get("build_time"),
                    "domoticz_url": DOMOTICZ_BASE_URL
                },
                "counts": {
                    "devices": len(devices),
                    "scenes_and_groups": len(scenes),
                    "user_variables": len(vars),
                    "rooms_plans": len(plans),
                    "hardware_gateways": len(hardware)
                }
            }
            
            if detail_level != "minimal":
                # Add a sample of favorite/active devices
                favorites = [d for d in devices if d.get("Favorite") == 1][:10]
                overview["favorite_devices"] = [_simplify_device(d) for d in favorites]
                
            return json.dumps({"status": "OK", "result": overview})
  • Registration of get_overview as an MCP tool via the @mcp.tool() decorator on line 396.
    @mcp.tool()
  • The _simplify_device helper function used by get_overview when detail_level is not minimal, to reduce device dicts to essential fields.
    def _simplify_device(dev: Dict[str, Any]) -> Dict[str, Any]:
        """Reduce device dictionary to essential fields to save context space."""
        keys_to_keep = [
            "idx", "Name", "Type", "SubType", "Data", "Status", 
            "BatteryLevel", "Favorite", "HardwareName", "LastUpdate", 
            "TypeImg", "Usage", "CounterToday", "Temp", "Humidity"
        ]
        return {k: dev[k] for k in keys_to_keep if k in dev}
  • Input schema for get_overview: the detail_level parameter accepts 'minimal' (default) or 'standard'.
    Args:
        detail_level: 'minimal' (default) for counts and summary, 'standard' for including a sample of devices.
  • The _get_cached_data helper used by get_overview to fetch and cache data from the Domoticz API with TTL-based caching.
    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"]
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only describes the detail_level parameter but does not mention side effects, permissions, or whether the tool is read-only. The output schema may cover return format, but the description lacks behavioral context.

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 extremely concise: three lines, with the purpose stated first, followed by parameter details. No wasted words.

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?

For a simple tool with one optional parameter and a provided output schema, the description is adequate. It explains the parameter options and implies the tool returns a summary. Minor missing: no note on what the 'sample of devices' includes.

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?

The schema coverage is 0% (no parameter descriptions in schema), so the description fully compensates by explaining the two values for detail_level and their defaults. This adds significant meaning beyond the raw schema.

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 'Get a high-level overview of the Domoticz system', which is a specific verb+resource. This distinguishes it from sibling tools that focus on specific entities (e.g., get_all_devices, get_battery_levels).

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 explicit guidance on when to use this tool versus alternatives. The description implies it's for a broad overview but does not specify when not to use it or mention any prerequisites or context.

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