Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_scenes

Retrieve all scenes and groups from your Domoticz system to monitor and manage smart home configurations.

Instructions

Get all scenes and groups from Domoticz.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `get_scenes` tool handler: decorated with @mcp.tool(), fetches all scenes/groups from Domoticz using cached API call and returns them as JSON.
    @mcp.tool()
    async def get_scenes() -> str:
        """Get all scenes and groups from Domoticz."""
        async with create_client() as client:
            scenes = await _get_cached_data(client, _scene_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getscenes")
            return json.dumps({"status": "OK", "result": scenes})
  • The tool is registered via @mcp.tool() decorator on line 658.
    @mcp.tool()
    async def get_scenes() -> str:
  • _resolve_scene_idx helper resolves a scene name or idx, used for scene-related operations.
    async def _resolve_scene_idx(client: "httpx.AsyncClient", idx: Optional[int] = None, name: Optional[str] = None) -> Optional[int]:
        """Resolve a scene to its idx."""
        return await _resolve_idx(client, idx, name, _scene_cache, f"{DOMOTICZ_API_URL}?type=command¶m=getscenes")
  • _get_cached_data helper fetches and caches API data, used by get_scenes to avoid repeated calls.
    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 get_scenes function has no parameters - the type signature () -> str defines its schema implicitly.
    @mcp.tool()
    async def get_scenes() -> str:
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It only states the basic action ('Get all scenes and groups') without disclosing read-only nature, caching, rate limits, or potential errors. The output schema exists but the description does not describe its structure.

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 consists of a single, clear sentence with no redundant information. It is appropriately sized for a parameterless tool and efficiently conveys the purpose.

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 the tool has no parameters and includes an output schema, the description is sufficient for an agent to understand its function. It could briefly mention the output format or use cases, but for a simple retrieval tool, it meets the minimum completeness requirements.

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 input schema has no parameters, and schema coverage is 100%. With zero parameters, the baseline is 4. The description correctly implies no additional inputs are needed, so no further semantic detail is required.

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 all scenes and groups from Domoticz', specifying the verb (get) and resource (scenes and groups). It distinguishes from sibling tools like 'get_scene_devices' (which gets devices within a scene) and 'switch_scene' (which activates a scene).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/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 vs alternatives. While it is clear that this tool lists all scenes and groups, it does not mention exclusions or suggest when to use 'get_scene_devices' or 'switch_scene' instead. Implicit context exists but lacks explicit differentiation.

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