add_log_message
Add custom messages 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
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| level | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:1089-1094 (handler)Handler for the add_log_message MCP tool. Registers via @mcp.tool() decorator. Takes a message string and optional level (1=normal, 2=status, 4=error), makes a GET request to Domoticz API's addlogmessage endpoint, and returns the response.
@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 - src/domoticz_mcp/server.py:1089-1089 (registration)Registration of add_log_message as an MCP tool via the @mcp.tool() decorator on the FastMCP instance 'mcp' (line 70).
@mcp.tool() - src/domoticz_mcp/server.py:1091-1091 (schema)Input schema/description for add_log_message: message (string, required) and level (int, default 2) with valid values 1=normal, 2=status, 4=error.
"""Add a custom message to the Domoticz system log. level: 1=normal, 2=status, 4=error."""