Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_events

Retrieve an overview of internal event system scripts and rules to understand automated behaviors in Domoticz.

Instructions

Get overview of the internal event system scripts and rules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main tool implementation for get_events. Calls Domoticz API with param=events&evparam=list, caches the result using _device_cache, and returns JSON.
    @mcp.tool()
    async def get_events() -> str:
        """Get overview of the internal event system scripts and rules."""
        async with create_client() as client:
            events = await _get_cached_data(client, _device_cache, f"{DOMOTICZ_API_URL}?type=command¶m=events&evparam=list")
            return json.dumps({"status": "OK", "result": events})
  • Registered as an MCP tool via the @mcp.tool() decorator on the get_events async function.
    @mcp.tool()
  • Tool takes no parameters and returns a JSON string. The docstring describes it as returning an overview of the internal event system scripts and rules.
    @mcp.tool()
    async def get_events() -> str:
        """Get overview of the internal event system scripts and rules."""
  • Helper function used by get_events to fetch and cache 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"]
  • A resource handler also exposing the events data at the domoticz://events URI, using the same Domoticz API endpoint.
    @mcp.resource("domoticz://events")
    async def get_events_resource() -> str:
        """Read the overview of the internal event system scripts and rules."""
        async with create_client() as client:
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=events&evparam=list")
            return response.text
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states 'Get overview' implying read-only, but does not disclose what data is included, pagination, permissions, or side effects. The output schema exists but is not described.

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, well-formed sentence with no extraneous words. It is front-loaded and concise.

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?

Given no parameters, an output schema exists, and no annotations, the description is adequate for a basic overview tool. However, it could elaborate on the content of the overview (e.g., list of scripts? rules details?) to be fully 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?

There are zero parameters, and schema description coverage is 100%. The description does not need to add parameter semantics. Baseline 4 is appropriate as it is clear and requires no further param info.

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?

The description clearly states it retrieves an overview of internal event system scripts and rules, using a specific verb and resource. It distinguishes from the sibling 'get_event' which presumably gets a single event, though it could be more explicit about the distinction.

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?

There is no guidance on when to use this tool versus alternatives like 'get_event' or 'search_scripts'. The description lacks context for decision-making.

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