Skip to main content
Glama

discord_delete_dm

Delete a bot-sent message from a Discord DM using the user ID and message ID.

Instructions

Delete a message 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).

Implementation Reference

  • Schema definition for discord_delete_dm, requiring user_id and message_id.
    {
      name: "discord_delete_dm",
      description:
        "Delete a message sent by the bot in a DM.",
      inputSchema: {
        type: "object",
        properties: {
          ...userIdProp,
          ...messageIdProp,
        },
        required: ["user_id", "message_id"],
      },
  • Handler logic for discord_delete_dm: fetches user, creates DM, fetches message, checks it was sent by the bot, and deletes it.
    case "discord_delete_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 delete messages sent by the bot.");
      await msg.delete();
      return { content: [{ type: "text", text: `✅ DM message ${msgId} deleted for ${user.username}.` }] };
    }
  • The dm module (which defines discord_delete_dm) is registered as a tool module in the modules array.
    import dm from "./dm.js";
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states the tool deletes only bot messages, but omits details about permanence, error handling (e.g., if message not found or not a bot message), or any side effects.

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

Conciseness4/5

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

The description is a single sentence with 9 words, very concise. It conveys the core purpose without unnecessary elaboration, though it could be slightly more informative.

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 no output schema and siblings, the description is insufficient. It does not explain error scenarios, prerequisites (e.g., bot must have sent the message), or the effect of deletion. Important context for a deletion tool is missing.

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%, so the parameters are already described. The description adds no extra meaning beyond the schema; it is a basic restatement.

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 tool deletes a message sent by the bot in a DM, specifying verb and resource. It distinguishes from sibling tools like 'discord_send_dm' or 'discord_edit_dm' which perform other actions.

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?

The description does not explicitly guide when to use this tool versus alternatives like 'discord_edit_dm' or 'discord_read_dms'. The context is implied but no exclusions or conditions are provided.

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