broadcast_text_message
Send plain text messages to all followers of a LINE Official Account for announcements or updates using the LINE Bot MCP Server.
Instructions
Broadcast a simple text message via LINE to all users who have followed your LINE Official Account. Use this for sending plain text messages without formatting. 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/broadcastTextMessage.ts:26-37 (handler)The asynchronous handler function that executes the broadcast_text_message tool logic, using the LINE messaging API to broadcast the message to all users.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/broadcastTextMessage.ts:19-38 (registration)Registers the 'broadcast_text_message' tool on the MCP server, specifying name, description, input schema, and handler function.server.tool( "broadcast_text_message", "Broadcast a simple text message via LINE to all users who have followed your LINE Official Account. Use this for sending " + "plain text messages without formatting. Please be aware that this message will be sent to all users.", { message: textMessageSchema, }, 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/common/schema/textMessage.ts:3-9 (schema)Zod schema defining the input structure for the text message parameter.export const textMessageSchema = z.object({ type: z.literal("text").default("text"), text: z .string() .max(5000) .describe("The plain text content to send to the user."), });
- src/index.ts:63-63 (registration)Instantiates the BroadcastTextMessage class with the messaging API client and calls its register method to add the tool to the MCP server.new BroadcastTextMessage(messagingApiClient).register(server);