get_events
Get an overview of Domoticz's internal event system scripts and rules to inspect and manage your home automation logic.
Instructions
Get overview of the internal event system scripts and rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:821-828 (handler)The get_events tool function - handler that fetches events list from Domoticz API with pagination support (offset/limit).
@mcp.tool() async def get_events(offset: int = 0, limit: int = 50) -> str: """Get 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") events = response.json().get("result", []) paginated = _paginate(events, offset, limit) return json.dumps({"status": "OK", "result": paginated, "total_count": len(events), "offset": offset, "limit": limit}) - src/domoticz_mcp/server.py:821-828 (registration)The tool is registered via the @mcp.tool() decorator on line 821.
@mcp.tool() async def get_events(offset: int = 0, limit: int = 50) -> str: """Get 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") events = response.json().get("result", []) paginated = _paginate(events, offset, limit) return json.dumps({"status": "OK", "result": paginated, "total_count": len(events), "offset": offset, "limit": limit}) - src/domoticz_mcp/server.py:396-398 (helper)The _paginate helper function used by get_events for pagination support.
def _paginate(data: list, offset: int, limit: int) -> list: """Paginate a list of results.""" return data[offset:offset + limit]