Skip to main content
Glama

discord_edit_message

Update or modify previously sent Discord messages by specifying the channel ID, message ID, and new content. Ideal for correcting errors or revising information quickly within a server.

Instructions

Edit a previously sent message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe Discord channel ID
contentYesNew message content
messageIdYesThe message ID to edit

Implementation Reference

  • Handler function for editing Discord channel messages. Validates input using EditMessageSchema and delegates to DiscordService.editMessage(channelId, messageId, newMessage). This is the core execution logic for the message editing tool.
    async editMessage(channelId: string, messageId: string, newMessage: string): Promise<string> { const parsed = schemas.EditMessageSchema.parse({ channelId, messageId, newMessage }); return await this.discordService.editMessage(parsed.channelId, parsed.messageId, parsed.newMessage); }
  • Zod schema for validating input parameters to the discord_edit_message tool: channelId, messageId, newMessage.
    export const EditMessageSchema = z.object({ channelId: z.string().describe("Discord channel ID"), messageId: z.string().describe("Specific message ID"), newMessage: z.string().describe("New message content") });
  • Dynamic registration and dispatch mechanism. Converts snake_case tool names (e.g., 'discord_edit_message' -> 'discordEditMessage' or 'edit_message' -> 'editMessage') to camelCase method names on AutomationManager and executes them with parsed params. Entry point for tool execution.
    private async callAutomationMethod(action: string, params: any): Promise<string> { // Convert action name to method name (snake_case to camelCase) const methodName = action.replace(/_([a-z])/g, (g) => g[1].toUpperCase()); // Check if method exists if (typeof (this.automationManager as any)[methodName] === 'function') { // Call the method with params return await (this.automationManager as any)[methodName](...Object.values(params)); } throw new Error(`Method '${methodName}' not found in AutomationManager`); }

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/drvova/discord-mcp'

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