broadcast_messages
Send text or flex messages to all LINE followers simultaneously. Use this tool to distribute announcements, updates, or content to your entire audience at once.
Instructions
Broadcast one or more LINE messages to all followers (generic).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Array of LINE messages (text/flex) |
Implementation Reference
- src/tools/broadcastMessages.ts:34-46 (handler)The handler function that takes an array of messages and broadcasts them to all LINE followers using the client's broadcast method, handling success and error responses.async ({ messages }) => { try { const resp = await this.client.broadcast({ messages: messages as unknown as messagingApi.Message[], }); return createSuccessResponse(resp); } catch (e: any) { return createErrorResponse( `Failed to broadcast messages: ${e?.message || e}`, ); } }, );
- src/tools/broadcastMessages.ts:25-29 (schema)Zod schema for the 'messages' parameter: non-empty array of lineMessageSchema (text or flex messages).const messages = z .array(lineMessageSchema) .min(1) .describe("Array of LINE messages (text/flex)");
- src/tools/broadcastMessages.ts:12-14 (schema)Union schema for LINE messages: textMessageSchema, flexMessageSchema, or any.const lineMessageSchema = z .union([textMessageSchema, flexMessageSchema]) .or(z.any());
- src/index.ts:75-75 (registration)Instantiates the BroadcastMessages tool with the messaging API client and registers it on the MCP server.new BroadcastMessages(messagingApiClient).register(server);
- src/tools/broadcastMessages.ts:30-46 (registration)Registers the 'broadcast_messages' tool on the MCP server with schema, description, and handler.server.tool( "broadcast_messages", "Broadcast one or more LINE messages to all followers (generic).", { messages }, async ({ messages }) => { try { const resp = await this.client.broadcast({ messages: messages as unknown as messagingApi.Message[], }); return createSuccessResponse(resp); } catch (e: any) { return createErrorResponse( `Failed to broadcast messages: ${e?.message || e}`, ); } }, );