broadcast_flex_message
Send customizable flex messages to all LINE Official Account users using bubble or carousel layouts for rich content delivery.
Instructions
Broadcast a highly customizable flex message via LINE to all users who have added your LINE Official Account. Supports both bubble (single container) and carousel (multiple swipeable bubbles) layouts. Please be aware that this message will be sent to all users.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes |
Implementation Reference
- src/tools/broadcastFlexMessage.ts:27-38 (handler)The implementation of the broadcast_flex_message handler, which uses the LINE MessagingApiClient to broadcast the message.
async ({ message }) => { try { const response = await this.client.broadcast({ messages: [message as unknown as messagingApi.Message], }); return createSuccessResponse(response); } catch (error) { return createErrorResponse( `Failed to broadcast message: ${error.message}`, ); } }, - src/tools/broadcastFlexMessage.ts:18-40 (registration)The registration method for the broadcast_flex_message tool using the McpServer.
register(server: McpServer) { server.tool( "broadcast_flex_message", "Broadcast a highly customizable flex message via LINE to all users who have added your LINE Official Account. " + "Supports both bubble (single container) and carousel (multiple swipeable bubbles) layouts. Please be aware that " + "this message will be sent to all users.", { message: flexMessageSchema, }, async ({ message }) => { try { const response = await this.client.broadcast({ messages: [message as unknown as messagingApi.Message], }); return createSuccessResponse(response); } catch (error) { return createErrorResponse( `Failed to broadcast message: ${error.message}`, ); } }, ); }