Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

add_log_message

Add a custom message to the Domoticz system log with selectable severity levels: normal, status, or error.

Instructions

Add a custom message to the Domoticz system log. level: 1=normal, 2=status, 4=error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
levelNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The add_log_message async function is the tool handler that calls the Domoticz API to add a custom log message. It is decorated with @mcp.tool() which registers it as an MCP tool.
    @mcp.tool()
    async def add_log_message(message: str, level: int = 2) -> str:
        """Add a custom message to the Domoticz system log. level: 1=normal, 2=status, 4=error."""
        async with create_client() as client:
            response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=addlogmessage&message={urllib.parse.quote(message)}&level={level}")
            return response.text
  • Input definition/schema for add_log_message: 'message' (str, required) and 'level' (int, default=2) with docstring describing valid levels (1=normal, 2=status, 4=error).
    @mcp.tool()
    async def add_log_message(message: str, level: int = 2) -> str:
  • The @mcp.tool() decorator on line 1033 registers add_log_message as an MCP tool on the FastMCP 'Domoticz' instance.
    async def add_log_message(message: str, level: int = 2) -> str:
  • Calls _do_request helper and urllib.parse.quote to send the message to Domoticz API endpoint with param=addlogmessage&message={encoded_message}&level={level}.
    async with create_client() as client:
        response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=addlogmessage&message={urllib.parse.quote(message)}&level={level}")
Behavior3/5

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

No annotations are provided, so the description carries full burden. It explains the level parameter's meaning but does not disclose any side effects, error behavior, or execution context beyond the basic logging action.

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?

Two sentences, no unnecessary words. The purpose and parameter mapping are presented succinctly and front-loaded, making it efficient for agent scanning.

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 log-writing tool with two parameters and an output schema present (which need not describe return values), the description provides sufficient context: purpose, parameter semantics for level. A minor improvement would be noting the default level value, but not essential.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description adds meaning to the 'level' parameter by mapping values to log levels, but the 'message' parameter is left without additional context. This partially compensates for the lack of schema descriptions.

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 action (Add) and resource (custom message to the Domoticz system log). Among siblings, no other tool writes to the system log, so it is well-differentiated.

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?

The description implies the tool is for adding messages but does not explicitly mention when to use it versus alternatives like get_log for reading logs. It lacks explicit when-not-to-use guidance.

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