Skip to main content
Glama

push_text_message

Send plain text messages to LINE users through the LINE Bot MCP Server. This tool enables AI agents to deliver text content directly to specified user IDs without formatting.

Instructions

Push a simple text message to a user via LINE. Use this for sending plain text messages without formatting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoThe user ID to receive a message. Defaults to DESTINATION_USER_ID.U1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p
messageYes

Implementation Reference

  • The core handler function that sends a text message to a LINE user using the messaging API client. It checks for userId, pushes the message, and handles errors with standardized responses.
    async ({ userId, message }) => { if (!userId) { return createErrorResponse(NO_USER_ID_ERROR); } try { const response = await this.client.pushMessage({ to: userId, messages: [message as unknown as messagingApi.Message], }); return createSuccessResponse(response); } catch (error) { return createErrorResponse( `Failed to push message: ${error.message}`, ); } },
  • Input schema for the push_text_message tool, consisting of userId (string, default destinationId) and message (textMessageSchema).
    { userId: userIdSchema, message: textMessageSchema, },
  • Zod schema defining the structure of a LINE text message: type 'text' and text string up to 5000 chars.
    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."), });
  • The register method in PushTextMessage class that registers the tool on the MCP server, including name, description, schema, and handler.
    register(server: McpServer) { const userIdSchema = z .string() .default(this.destinationId) .describe( "The user ID to receive a message. Defaults to DESTINATION_USER_ID.", ); server.tool( "push_text_message", "Push a simple text message to a user via LINE. Use this for sending plain text messages without formatting.", { userId: userIdSchema, message: textMessageSchema, }, async ({ userId, message }) => { if (!userId) { return createErrorResponse(NO_USER_ID_ERROR); } try { const response = await this.client.pushMessage({ to: userId, messages: [message as unknown as messagingApi.Message], }); return createSuccessResponse(response); } catch (error) { return createErrorResponse( `Failed to push message: ${error.message}`, ); } }, ); }
  • src/index.ts:61-61 (registration)
    Instantiation of PushTextMessage tool with LINE client and destination ID, and registration on the MCP server.
    new PushTextMessage(messagingApiClient, destinationId).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