Skip to main content
Glama

update_message

Modify existing Slack messages by providing channel ID, timestamp, and new text content to correct errors or update information.

Instructions

Update an existing message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesChannel ID
tsYesMessage timestamp
textYesNew message text

Implementation Reference

  • The main execution handler for the 'update_message' tool. It validates input using updateMessageSchema, calls Slack's chat.update method, and returns the updated message details.
    export async function updateMessage(client: SlackClientWrapper, args: unknown) { const params = updateMessageSchema.parse(args); return await client.safeCall(async () => { const result = await client.getClient().chat.update({ channel: params.channel, ts: params.ts, text: params.text, }); return { ok: true, channel: result.channel, ts: result.ts, message: result.message, }; }); }
  • Zod schema for input validation of the update_message tool, requiring channel ID, message timestamp, and new text.
    export const updateMessageSchema = z.object({ channel: channelIdSchema, ts: timestampSchema, text: z.string().min(1), });
  • src/index.ts:427-427 (registration)
    Registers the 'update_message' tool handler in the toolHandlers map, delegating to messageTools.updateMessage.
    update_message: (args) => messageTools.updateMessage(slackClient, args),
  • src/index.ts:195-216 (registration)
    Defines the 'update_message' tool in the tools list for list_tools, including JSON input schema mirroring the Zod schema.
    { name: 'update_message', description: 'Update an existing message', inputSchema: { type: 'object', properties: { channel: { type: 'string', description: 'Channel ID', }, ts: { type: 'string', description: 'Message timestamp', }, text: { type: 'string', description: 'New message text', }, }, required: ['channel', 'ts', 'text'], }, },

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/Hais/slack-bot-mcp'

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