send_notification
Send a notification to Domoticz notification subsystems with a subject and body to alert users about smart home events.
Instructions
Send a notification through Domoticz notification subsystems.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subject | Yes | ||
| body | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:1041-1046 (handler)The actual handler function for the send_notification MCP tool. It sends a notification through Domoticz by making a GET request to the Domoticz JSON API with the subject and body parameters URL-encoded.
@mcp.tool() async def send_notification(subject: str, body: str) -> str: """Send a notification through Domoticz notification subsystems.""" async with create_client() as client: response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=sendnotification&subject={urllib.parse.quote(subject)}&body={urllib.parse.quote(body)}") return response.text - src/domoticz_mcp/server.py:1041-1042 (registration)The tool is registered using the @mcp.tool() decorator on the send_notification async function, which registers it with the FastMCP 'Domoticz' instance.
@mcp.tool() async def send_notification(subject: str, body: str) -> str: - src/domoticz_mcp/server.py:1042-1042 (schema)The input schema defines two string parameters: subject (the notification subject) and body (the notification body/contents). The return type is str.
async def send_notification(subject: str, body: str) -> str: