zeph_broadcast
Send a push notification to all subscribers of a channel. Provide channel ID and title, with optional body, URL, and priority.
Instructions
Send a push notification to all subscribers of a channel. Use zeph://channels resource to find available channels.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | Channel ID to broadcast to (e.g., "ch_...") | |
| title | Yes | Notification title | |
| body | No | Notification body text | |
| url | No | Optional URL to open on the device. | |
| priority | No | Notification priority | normal |
Implementation Reference
- src/tools/broadcast.ts:6-44 (handler)The main handler function 'registerBroadcastTool' that registers the 'zeph_broadcast' tool on the MCP server. The handler calls client.sendPush with channelId, title, body, url, and priority parameters, returning the pushId and channelId on success.
export const registerBroadcastTool = (server: McpServer, client: ZephApiClient) => { server.registerTool( 'zeph_broadcast', { description: 'Send a push notification to all subscribers of a channel. Use zeph://channels resource to find available channels.', annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true, }, inputSchema: { channelId: z.string().describe('Channel ID to broadcast to (e.g., "ch_...")'), title: z.string().describe('Notification title'), body: z.string().optional().describe('Notification body text'), url: z.string().url().optional().describe('Optional URL to open on the device.'), priority: z .enum(['low', 'normal', 'high', 'urgent']) .default('normal') .describe('Notification priority'), }, }, async ({ channelId, title, body, url, priority }) => { try { const result = await client.sendPush({ title, body, url, type: 'hook', priority, channelId, }); return textResult({ pushId: result.data.pushId, channelId }); } catch (err) { return formatToolError(err); } }, ); }; - src/tools/broadcast.ts:17-26 (schema)Input schema for zeph_broadcast: channelId (string), title (string), body (optional string), url (optional URL string), priority (enum low/normal/high/urgent, default 'normal').
inputSchema: { channelId: z.string().describe('Channel ID to broadcast to (e.g., "ch_...")'), title: z.string().describe('Notification title'), body: z.string().optional().describe('Notification body text'), url: z.string().url().optional().describe('Optional URL to open on the device.'), priority: z .enum(['low', 'normal', 'high', 'urgent']) .default('normal') .describe('Notification priority'), }, - src/index.ts:15-15 (registration)Import of registerBroadcastTool from './tools/broadcast.js'.
import { registerBroadcastTool } from './tools/broadcast.js'; - src/index.ts:65-65 (registration)Registration call: registerBroadcastTool(server, client) invoked in the server setup.
registerBroadcastTool(server, client); - src/api-client.ts:37-48 (helper)The sendPush method on ZephApiClient that makes the actual POST /pushes/send API request, used by the broadcast handler.
async sendPush(params: { title: string; body?: string; url?: string; type?: string; priority?: string; targetDeviceId?: string; channelId?: string; files?: { fileKey: string; fileName: string; fileSize: number; fileType: string }[]; }): Promise<PushResponse> { return this.request<PushResponse>('POST', '/pushes/send', params); }