broadcast_text_message
Send plain text messages to all LINE Official Account followers simultaneously using this broadcasting tool for announcements and updates.
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)Executes the broadcast_text_message tool by calling the LINE API's broadcast method with the provided text 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/common/schema/textMessage.ts:3-9 (schema)Zod schema defining the structure of a text message: type 'text' and text string up to 5000 characters.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/tools/broadcastTextMessage.ts:18-39 (registration)Registers the 'broadcast_text_message' tool on the MCP server, including name, description, input schema, and handler.register(server: McpServer) { 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/index.ts:63-63 (registration)Instantiates and registers the BroadcastTextMessage tool with the MCP server.new BroadcastTextMessage(messagingApiClient).register(server);