Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_log

Retrieve the main system log filtered by time and severity to monitor home automation events.

Instructions

Retrieve the main system log. lastlogtime is seconds since epoch, loglevel is bitmask.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lastlogtimeNo
loglevelNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'get_log'. It retrieves the main Domoticz system log with parameters lastlogtime (seconds since epoch) and loglevel (bitmask).
    @mcp.tool()
    async def get_log(lastlogtime: int = 0, loglevel: int = 268435455) -> str:
        """Retrieve the main system log. lastlogtime is seconds since epoch, loglevel is bitmask."""
        async with create_client() as client:
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=getlog&lastlogtime={lastlogtime}&loglevel={loglevel}")
            return response.text
  • The tool is registered with the MCP framework using the @mcp.tool() decorator on line 1027.
    @mcp.tool()
    async def get_log(lastlogtime: int = 0, loglevel: int = 268435455) -> str:
  • Input schema: lastlogtime (int, default 0) and loglevel (int, default 268435455 which is all log levels) as described in the docstring.
    async def get_log(lastlogtime: int = 0, loglevel: int = 268435455) -> str:
        """Retrieve the main system log. lastlogtime is seconds since epoch, loglevel is bitmask."""
        async with create_client() as client:
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=getlog&lastlogtime={lastlogtime}&loglevel={loglevel}")
            return response.text
  • A related resource 'domoticz://log' that also reads the system log using getlog with all log levels (268435455 = 0xFFFFFFF).
    @mcp.resource("domoticz://log")
    async def get_log_resource() -> str:
        """Read the current Domoticz system log."""
        async with create_client() as client:
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=getlog&lastlogtime=0&loglevel=268435455")
            return response.text
  • Another related resource 'domoticz://logs/error' that reads only Error-level (loglevel=4) log entries.
    @mcp.resource("domoticz://logs/error")
    async def get_error_logs_resource() -> str:
        """Read only the 'Error' level entries from the Domoticz system log."""
        async with create_client() as client:
            # loglevel 4 is ERR
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=getlog&lastlogtime=0&loglevel=4")
            return response.text
Behavior3/5

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

No annotations are provided, so the description must bear the full burden. It explains parameter semantics (lastlogtime as seconds, loglevel as bitmask) but does not disclose behavioral traits like read-only nature, data volume, or system impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of one sentence for purpose and two clarifications for parameters. It is front-loaded with the core action, though it could be slightly more structured.

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 the absence of annotations and the presence of an output schema, the description is minimally adequate but lacks details on return format, pagination, or error scenarios. It does not fully compensate for missing annotation context.

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?

Schema description coverage is 0%, so the description compensates by explaining lastlogtime as 'seconds since epoch' and loglevel as 'bitmask', adding significant meaning beyond the schema's type and default values.

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 tool retrieves 'the main system log', providing a specific verb and resource. It distinguishes itself from sibling tools like get_system_health and get_system_status by focusing on log retrieval.

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?

The description gives no guidance on when to use this tool versus alternatives (e.g., get_system_health, get_events). It lacks context on prerequisites, typical use cases, 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