Skip to main content
Glama
drvova

Discord MCP Server

discord_edit_message

Edit existing Discord messages by providing channel ID, message ID, and new content to update text in Discord channels.

Instructions

Edit a previously sent message

Input Schema

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

Implementation Reference

  • The core handler function for the 'discord_edit_message' tool. It validates the input parameters using the EditMessageSchema and delegates the actual Discord API call to DiscordService.editMessage.
    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 that defines and validates the input parameters for 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/dispatch mechanism that converts snake_case action names (e.g., 'edit_message' or 'discord_edit_message') to camelCase method names on AutomationManager and invokes them.
    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`);
    }
  • Entry point for executing tools/actions, including permission checks via ConfigManager, logging, rate limiting, and delegation to specific handlers via callAutomationMethod.
    async executeAction(action: string, params: any): Promise<string> {
      try {
        // Check if action is allowed
        if (!this.configManager.isActionAllowed(action)) {
          throw ErrorHandler.createPermissionError(`Action '${action}' is not allowed`);
        }
        
        // Log the operation
        this.logger.logOperation(action, params);
        
        // Wait for rate limits if needed
        if (this.configManager.getConfig().rateLimitProtection) {
          await this.rateLimiter.waitForRateLimit(action);
        }
        
        // Execute the action using reflection-like approach
        const result = await this.callAutomationMethod(action, params);
        
        this.logger.info(`Action '${action}' executed successfully`);
        return result;
      } catch (error) {
        this.logger.logError(`Action '${action}' failed`, error);
        ErrorHandler.handle(error);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Edit' implies a mutation operation, the description doesn't address critical behavioral aspects: permission requirements, rate limits, whether edits are reversible, how Discord handles edit history, or what happens if the message doesn't exist. For a mutation tool with zero annotation coverage, this leaves the agent with insufficient operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a straightforward editing operation and front-loads the essential information. Every word earns its place, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after editing (success/failure responses), error conditions, or behavioral constraints. While the schema covers parameters well, the operational context for a Discord message edit requires more guidance about permissions, limitations, and outcomes than the current description provides.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all three parameters clearly documented in the schema (channelId, messageId, content with maxLength). The description adds no additional parameter information beyond what the schema provides. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Edit') and resource ('a previously sent message'), making the purpose immediately understandable. It distinguishes from siblings like discord_send_message (create) and discord_delete_message (remove), though it doesn't explicitly mention these distinctions. The verb+resource combination is specific but could be more precise about what aspects can be edited.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing to have sent the message or have appropriate permissions), when editing is appropriate versus deleting/resending, or how it differs from similar operations. With multiple message-related siblings (send_message, delete_message, get_message), this lack of contextual guidance is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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