Skip to main content
Glama
aahl

MCP Server for notify to weixin / telegram / bark / lark

by aahl

Bark推送通知

bark_send_notify

Send customizable push notifications to iOS devices via Bark, supporting title, body, subtitle, device key, URL, icon, interrupt level, and volume.

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 actual handler function for the 'bark_send_notify' tool. It sends a push notification via the Bark API (https://api.day.app) using the provided parameters (body, title, subtitle, device_key, url, icon, level, volume). Falls back to env vars for device_key and base URL.
    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 @mcp.tool decorator registering 'bark_send_notify' with FastMCP, providing its title and description.
    @mcp.tool(
        title="Bark推送通知",
        description="通过Bark推送通知",
    )
  • The function signature defines the input schema using Pydantic Field descriptors 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"),
    ):

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.0

TDQS

C2.9/5.0
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.