Skip to main content
Glama

broadcast_messages

Send text or flex messages to all LINE followers simultaneously. Use this tool to distribute announcements, updates, or notifications across your LINE channel.

Instructions

Broadcast one or more LINE messages to all followers (generic).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of LINE messages (text/flex)

Implementation Reference

  • The handler function that executes the broadcast_messages tool logic: calls LINE broadcast API with messages, returns success or error response.
    async ({ messages }) => { try { const resp = await this.client.broadcast({ messages: messages as unknown as messagingApi.Message[], }); return createSuccessResponse(resp); } catch (e: any) { return createErrorResponse( `Failed to broadcast messages: ${e?.message || e}`, ); } },
  • Zod input schema for the tool parameter 'messages': non-empty array of LINE messages (text or flex).
    const messages = z .array(lineMessageSchema) .min(1) .describe("Array of LINE messages (text/flex)");
  • Zod schema defining a LINE message as union of textMessageSchema or flexMessageSchema.
    const lineMessageSchema = z .union([textMessageSchema, flexMessageSchema]) .or(z.any());
  • The register method of BroadcastMessages class that defines and registers the 'broadcast_messages' tool on the MCP server.
    register(server: McpServer) { const messages = z .array(lineMessageSchema) .min(1) .describe("Array of LINE messages (text/flex)"); server.tool( "broadcast_messages", "Broadcast one or more LINE messages to all followers (generic).", { messages }, async ({ messages }) => { try { const resp = await this.client.broadcast({ messages: messages as unknown as messagingApi.Message[], }); return createSuccessResponse(resp); } catch (e: any) { return createErrorResponse( `Failed to broadcast messages: ${e?.message || e}`, ); } }, ); }
  • src/index.ts:75-75 (registration)
    Top-level instantiation and registration of the BroadcastMessages tool on the main MCP server instance.
    new BroadcastMessages(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