Skip to main content
Glama

broadcast_flex_message

Send customizable flex messages to all LINE Official Account followers using bubble or carousel layouts for rich, interactive 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
NameRequiredDescriptionDefault
messageYes

Implementation Reference

  • The core handler function that broadcasts the provided flex message to all users using the LINE Messaging API client, handling success and error responses.
    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}`, ); } },
  • Zod schema defining the structure of the input flex message, including type, altText, and contents with bubble or carousel support.
    export const flexMessageSchema = z.object({ type: z.literal("flex").default("flex"), altText: z .string() .describe("Alternative text shown when flex message cannot be displayed."), contents: z .object({ type: z .enum(["bubble", "carousel"]) .describe( "Type of the container. 'bubble' for single container, 'carousel' for multiple swipeable bubbles.", ), }) .passthrough() .describe( "Flexible container structure following LINE Flex Message format. For 'bubble' type, can include header, " + "hero, body, footer, and styles sections. For 'carousel' type, includes an array of bubble containers in " + "the 'contents' property.", ), });
  • Registers the 'broadcast_flex_message' tool on the MCP server with name, description, input schema, and handler function.
    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}`, ); } }, );
  • src/index.ts:64-64 (registration)
    Instantiates and registers the BroadcastFlexMessage tool instance with the MCP server in the main entry point.
    new BroadcastFlexMessage(messagingApiClient).register(server);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tndfame/mcp_management'

If you have feedback or need assistance with the MCP directory API, please join our Discord server