Skip to main content
Glama

ntfy_send_notify

Send push notifications via Ntfy with customizable messages, titles, priorities, attachments, and action buttons for cross-platform alerting.

Instructions

Push a notification via Ntfy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesNotification message body; set to `triggered` if empty or not passed
titleNoNotification title
topicNoTarget topic name or URL
clickNoURL opened when notification is clicked
attachNoURL of an attachment
iconNoURL of notification icon
markdownNoSet to `true` if the message is Markdown-formatted
filenameNoFile name of the attachment
priorityNoMessage priority with 1=min, 3=default and 5=max
delayNoTimestamp or duration for delayed delivery. Example: 30min, 9am
actionsNoList of action buttons. The following actions are supported: - view: Opens a website or app when the action button is tapped - broadcast: Sends an Android broadcast intent when the action button is tapped (only supported on Android) - http: Sends HTTP POST/GET/PUT request when the action button is tapped ```json [ { "action": "view", "label": "Open portal", "url": "https://home.nest.com/", "clear": true }, { "action": "http", "label": "Turn down", "url": "https://api.nest.com/", "body": "{"temperature": 65}" }, { "action": "broadcast", "label": "Take picture", "extras": { "cmd": "pic", "camera": "front" } } ] ```

Implementation Reference

  • Complete implementation of the `ntfy_send_notify` tool, including @mcp.tool registration decorator, input schema via Pydantic Fields, and handler logic that constructs and sends a JSON payload to the ntfy server.
    @mcp.tool(
        title="Ntfy Push Notification",
        description="Push a notification via Ntfy",
    )
    def ntfy_send_notify(
        message: str = Field(description="Notification message body; set to `triggered` if empty or not passed"),
        title: str = Field("", description="Notification title"),
        topic: str = Field("", description="Target topic name or URL"),
        click: str = Field("", description="URL opened when notification is clicked"),
        attach: str = Field("", description="URL of an attachment"),
        icon: str = Field("", description="URL of notification icon"),
        markdown: bool = Field(False, description="Set to `true` if the message is Markdown-formatted"),
        filename: str = Field("", description="File name of the attachment"),
        priority: int = Field(3, description="Message priority with 1=min, 3=default and 5=max"),
        delay: str = Field("", description="Timestamp or duration for delayed delivery. Example: 30min, 9am"),
        actions: list | None = Field(None, description=f"List of action buttons.{NTFY_ACTIONS_RULE}"),
    ):
        """
        https://docs.ntfy.sh/publish/#publish-as-json
        """
        base = os.getenv("NTFY_BASE_URL") or "https://ntfy.sh"
        if topic and topic.startswith("http"):
            base, topic = topic.rsplit("/", 1)
        if not topic:
            topic = os.getenv("NTFY_DEFAULT_TOPIC", "")
        data = {
            "topic": topic,
            "title": title,
            "message": message,
            "click": click,
            "icon": icon,
            "markdown": markdown or False,
            "priority": priority,
            "delay": delay,
        }
        if attach:
            data["attach"] = attach
            data["filename"] = filename
        if actions:
            data["actions"] = actions
        res = requests.post(f"{base}", json=data)
        return res.json()
  • Top-level MCP server initialization and registration of all tool modules, including `other.add_tools(mcp)` which registers the ntfy_send_notify tool.
    mcp = FastMCP(name="mcp-notify", version="0.1.8")
    wework.add_tools(mcp)
    tgbot.add_tools(mcp)
    other.add_tools(mcp)
    hass.add_tools(mcp)
    util.add_tools(mcp)
  • Pydantic Field-based input schema defining parameters for the ntfy_send_notify tool.
        message: str = Field(description="Notification message body; set to `triggered` if empty or not passed"),
        title: str = Field("", description="Notification title"),
        topic: str = Field("", description="Target topic name or URL"),
        click: str = Field("", description="URL opened when notification is clicked"),
        attach: str = Field("", description="URL of an attachment"),
        icon: str = Field("", description="URL of notification icon"),
        markdown: bool = Field(False, description="Set to `true` if the message is Markdown-formatted"),
        filename: str = Field("", description="File name of the attachment"),
        priority: int = Field(3, description="Message priority with 1=min, 3=default and 5=max"),
        delay: str = Field("", description="Timestamp or duration for delayed delivery. Example: 30min, 9am"),
        actions: list | None = Field(None, description=f"List of action buttons.{NTFY_ACTIONS_RULE}"),
    ):

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/aahl/mcp-notify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server