Skip to main content
Glama
tndfame
by tndfame

broadcast_flex_message

Send customizable flex messages to all LINE Official Account followers. Create bubble or carousel layouts with rich content for announcements and updates.

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 asynchronous handler function that performs the broadcast_flex_message tool logic by calling the LINE Messaging API's broadcast method with the provided flex 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}`,
          );
        }
      },
    );
  • Zod schema defining the structure of the input 'message' parameter for the broadcast_flex_message tool.
    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.",
        ),
    });
  • The register method that sets up the 'broadcast_flex_message' tool on the MCP server, including name, description, input schema reference, and handler function.
    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}`,
            );
          }
        },
      );
    }
  • src/index.ts:64-64 (registration)
    Instantiates the BroadcastFlexMessage class with the messaging API client and calls its register method on the main MCP server.
    new BroadcastFlexMessage(messagingApiClient).register(server);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the broadcast nature ('sent to all users') and mentions support for bubble/carousel layouts, but lacks details about permissions, rate limits, confirmation steps, or what happens on failure. The warning about broadcasting is helpful but incomplete for behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste. First sentence establishes purpose and capabilities, second provides crucial behavioral warning. Every word earns its place, and the most important information (broadcast nature) is appropriately front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a broadcast tool with no annotations, no output schema, and complex nested parameters, the description is moderately complete. It covers the broadcast scope and basic layout options but misses details about authentication requirements, error handling, response format, and the full complexity of the flex message structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions bubble/carousel layouts which correspond to the 'type' enum in the nested schema, but doesn't explain the 'altText' parameter or the complex 'contents' structure beyond basic layout types. This leaves significant gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('broadcast'), resource ('flex message'), and platform ('LINE to all users who have added your LINE Official Account'). It distinguishes from siblings like 'broadcast_text_message' by specifying the message type and from 'push_flex_message' by indicating broadcast vs targeted push.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: for sending flex messages to all LINE Official Account users. It implicitly distinguishes from sibling tools like 'broadcast_text_message' (text vs flex) and 'push_flex_message' (broadcast vs targeted), though it doesn't explicitly name alternatives or state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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