Skip to main content
Glama

discord_edit_dm

Edit a text message previously sent by the bot in a DM by providing the user ID, message ID, and new content.

Instructions

Edit a text message previously sent by the bot in a DM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe Discord user ID.
message_idYesThe message ID (must be a bot message).
contentYesNew text content for the message.

Implementation Reference

  • src/tools/dm.ts:98-111 (registration)
    Tool definition registration for discord_edit_dm including name, description, and inputSchema (requires user_id, message_id, content).
    {
      name: "discord_edit_dm",
      description:
        "Edit a text message previously sent by the bot in a DM.",
      inputSchema: {
        type: "object",
        properties: {
          ...userIdProp,
          ...messageIdProp,
          content: { type: "string", description: "New text content for the message." },
        },
        required: ["user_id", "message_id", "content"],
      },
    },
  • Handler implementation for discord_edit_dm: fetches user, creates DM channel, fetches the message, verifies it was sent by the bot, then edits it with new text content.
    case "discord_edit_dm": {
      const user = await discord.users.fetch(validateId(args.user_id, "user_id"));
      const dm = await user.createDM();
      const msgId = validateId(args.message_id, "message_id");
      const msg = await dm.messages.fetch(msgId);
      if (msg.author.id !== discord.user?.id) throw new Error("Can only edit messages sent by the bot.");
      await msg.edit(args.content as string);
      return { content: [{ type: "text", text: `✅ DM message ${msgId} edited for ${user.username}.` }] };
    }
  • Input schema for discord_edit_dm: userIdProp (user_id), messageIdProp (message_id), and content — all required.
    inputSchema: {
      type: "object",
      properties: {
        ...userIdProp,
        ...messageIdProp,
        content: { type: "string", description: "New text content for the message." },
      },
      required: ["user_id", "message_id", "content"],
    },
  • Import of the dm module (which contains discord_edit_dm) into the central tool registry.
    import dm from "./dm.js";
  • Helper property definitions for userIdProp and messageIdProp used across DM tool schemas including discord_edit_dm.
    const userIdProp = {
      user_id: { type: "string", description: "The Discord user ID." },
    } as const;
    
    const messageIdProp = {
      message_id: { type: "string", description: "The message ID (must be a bot message)." },
    } as const;
Behavior3/5

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

No annotations provided, so the description carries the full burden. It mentions the message must be previously sent by the bot, which is a key constraint. However, it does not disclose other behavioral aspects such as rate limits, permissions, or effects on message timestamps.

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?

A single, front-loaded sentence containing the essential action and constraints. Every word contributes meaning without redundancy.

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

Completeness4/5

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

For a simple edit tool, the description covers the core operation. It lacks details on error cases (e.g., message not found) but is sufficient for typical use. The absence of an output schema is acceptable given the simple return value.

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 coverage is 100% with explicit descriptions for each parameter. The description reinforces the schema but adds no new semantic detail beyond what is already in the parameter descriptions.

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

Purpose5/5

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

The description clearly states the verb 'Edit' and the resource 'a text message previously sent by the bot in a DM'. It distinguishes from sibling tools like discord_edit_dm_embed (embed editing) and discord_send_dm (sending).

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives like discord_edit_dm_embed or discord_delete_dm. The usage is implied but not clarified with conditions or exclusions.

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

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