Skip to main content
Glama

bark_send_notify

Send push notifications via Bark with customizable title, body, priority levels, and optional URL redirects for device alerts.

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 @mcp.tool decorator and bark_send_notify function provide both the registration and handler logic for sending Bark push notifications. It constructs a POST request to the Bark API with provided parameters and returns the JSON response.
    @mcp.tool( title="Bark推送通知", description="通过Bark推送通知", ) 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()
  • Top-level MCP server initialization where add_tools from other.py (containing bark_send_notify) is called to register the tool.
    wework.add_tools(mcp) tgbot.add_tools(mcp) other.add_tools(mcp) hass.add_tools(mcp) util.add_tools(mcp)
  • Imports the modules including other.py which defines the bark_send_notify tool.
    wework, tgbot, other, hass, util, )

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