Skip to main content
Glama

Bark推送通知

bark_send_notify

Send push notifications to iOS devices via Bark. Customize title, subtitle, URL, icon, and alert level to control urgency and display behavior.

Instructions

通过Bark推送通知

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes推送内容
titleNo推送标题
subtitleNo推送副标题
device_keyNo设备key,默认从环境变量获取
urlNo点击推送时,跳转的URL ,支持URL Scheme 和 Universal Link
iconNo自定义图标URL
levelNo推送中断级别。critical: 重要警告, 在静音模式下也会响铃active:默认值,系统会立即亮屏显示通知timeSensitive:时效性通知,可在专注状态下显示通知。passive:仅将通知添加到通知列表,不会亮屏提醒。active
volumeNo重要警告的通知音量(0-10),默认为5

Implementation Reference

  • The bark_send_notify function that executes the Bark push notification logic. It sends a POST request to the Bark API (default https://api.day.app) with the provided body, title, subtitle, device_key, url, icon, level, and volume parameters. Falls back to BARK_DEVICE_KEY and BARK_BASE_URL environment variables.
    def bark_send_notify(
        body: str = Field(description="推送内容"),
        title: str = Field("", description="推送标题"),
        subtitle: str = Field("", description="推送副标题"),
        device_key: str = Field("", description="设备key,默认从环境变量获取"),
        url: str = Field("", description="点击推送时,跳转的URL ,支持URL Scheme 和 Universal Link"),
        icon: str = Field("", description="自定义图标URL"),
        level: str = Field(
            "active",
            description="推送中断级别。"
                        "critical: 重要警告, 在静音模式下也会响铃"
                        "active:默认值,系统会立即亮屏显示通知"
                        "timeSensitive:时效性通知,可在专注状态下显示通知。"
                        "passive:仅将通知添加到通知列表,不会亮屏提醒。",
        ),
        volume: int = Field(5, description="重要警告的通知音量(0-10),默认为5"),
    ):
        """
        https://bark.day.app/#/tutorial
        """
        if not device_key:
            device_key = os.getenv("BARK_DEVICE_KEY", "")
        base = os.getenv("BARK_BASE_URL") or "https://api.day.app"
        res = requests.post(
            f"{base}/{device_key}",
            json={
                "body": body,
                "title": title,
                "subtitle": subtitle,
                "url": url,
                "icon": icon,
                "level": level,
                "volume": volume,
            },
        )
        return res.json()
  • The function signature with Pydantic Field definitions serving as input schema/validation for all parameters (body, title, subtitle, device_key, url, icon, level, volume).
    def bark_send_notify(
        body: str = Field(description="推送内容"),
        title: str = Field("", description="推送标题"),
        subtitle: str = Field("", description="推送副标题"),
        device_key: str = Field("", description="设备key,默认从环境变量获取"),
        url: str = Field("", description="点击推送时,跳转的URL ,支持URL Scheme 和 Universal Link"),
        icon: str = Field("", description="自定义图标URL"),
        level: str = Field(
            "active",
            description="推送中断级别。"
                        "critical: 重要警告, 在静音模式下也会响铃"
                        "active:默认值,系统会立即亮屏显示通知"
                        "timeSensitive:时效性通知,可在专注状态下显示通知。"
                        "passive:仅将通知添加到通知列表,不会亮屏提醒。",
        ),
        volume: int = Field(5, description="重要警告的通知音量(0-10),默认为5"),
    ):
  • The @mcp.tool decorator that registers bark_send_notify as an MCP tool, with title 'Bark推送通知' and description '通过Bark推送通知'.
    @mcp.tool(
        title="Bark推送通知",
        description="通过Bark推送通知",
    )
  • The call to other.add_tools(mcp) which registers all tools in other.py (including bark_send_notify) with the FastMCP instance.
    other.add_tools(mcp)
    hass.add_tools(mcp)
    util.add_tools(mcp)
Behavior1/5

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

No annotations are provided, and the description does not disclose any behavioral traits (e.g., side effects, permission requirements, or limits). The single sentence only restates the verb and resource.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise (one sentence) and no information is wasted. However, it lacks front-loading of critical details like required parameter 'body'.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 parameters and no output schema or annotations, a one-sentence description is insufficient. It does not explain return values, usage patterns, or how parameters like 'level' affect behavior.

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 100%, so the schema already documents each parameter. The description adds no extra meaning beyond the schema, meeting the baseline level.

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 tool's action (推送通知) and specific service (Bark). This distinguishes it from sibling tools like ding_send_text or lark_send_text, which target different platforms.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like ntfy_send_notify or pushplus_send_msg. There is no mention of prerequisites, context, or when not to use it.

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

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