send_notification
Display native OS notifications with customizable title, message, app name, and timeout. Works on Windows, macOS, and Linux.
Instructions
Send a system notification.
Displays a native operating system notification with the specified title and message.
Works across Windows, macOS, and Linux platforms.
Args:
title: The title of the notification (required)
message: The message body of the notification (required)
app_name: The name of the application sending the notification (optional)
timeout: Duration in seconds to display the notification (default: 10)
Returns:
A success message if the notification was sent successfully, or an error message if it failed.
Examples:
send_notification("Task Complete", "Your build has finished successfully")
send_notification("Warning", "Low disk space detected", app_name="System Monitor", timeout=5)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| message | Yes | ||
| app_name | No | ||
| timeout | No |
Implementation Reference
- src/server.py:53-92 (handler)The `send_notification` tool handler function. It uses plyer's notification.notify() to display native OS notifications. Accepts title (required), message (required), app_name (optional), and timeout (optional, default 10s). Returns a success or error string.
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True)) def send_notification( title: str, message: str, app_name: str | None = None, timeout: int = 10, ) -> str: """ Send a system notification. Displays a native operating system notification with the specified title and message. Works across Windows, macOS, and Linux platforms. Args: title: The title of the notification (required) message: The message body of the notification (required) app_name: The name of the application sending the notification (optional) timeout: Duration in seconds to display the notification (default: 10) Returns: A success message if the notification was sent successfully, or an error message if it failed. Examples: send_notification("Task Complete", "Your build has finished successfully") send_notification("Warning", "Low disk space detected", app_name="System Monitor", timeout=5) """ try: notification_params = { "title": title, "message": message, "timeout": timeout, } if app_name: notification_params["app_name"] = app_name notification.notify(**notification_params) return f"Notification sent successfully: '{title}'" except Exception as e: return f"Error sending notification: {e}" - src/server.py:53-53 (registration)The `send_notification` function is registered as an MCP tool via the `@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))` decorator on line 53. This registers it with the FastMCP server instance.
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))