Skip to main content
Glama

push_text_message

Send plain text messages to LINE users through the LINE Messaging API. Use this tool to deliver unformatted text content directly to specific user accounts.

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
messageYes
userIdNoThe user ID to receive a message. Defaults to DESTINATION_USER_ID.U1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p

Implementation Reference

  • The core execution logic of the tool: sends a text message to the specified LINE user ID using the bot SDK's pushMessage method, with validation and error handling.
    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}`, ); } },
  • Zod schema for the message parameter: requires 'type: "text"' and 'text' field 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."), });
  • Registers the tool on the MCP server, specifying name, description, input schema (userId and message), and the handler function.
    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)
    Instantiates the PushTextMessage class with the messaging client and destination ID, then calls register to add the tool to the main 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