Skip to main content
Glama

discord_send_dm_embed

Send a direct message with a customizable rich embed to any Discord user, including text, fields, images, and timestamps.

Instructions

Send a rich embed as a direct message to a user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe Discord user ID.
contentNoOptional text content above the embed.
titleNo
urlNoURL that makes the title clickable.
descriptionNo
colorNoHex color e.g. #5865F2
fieldsNo
authorNoAuthor block shown at the top of the embed.
thumbnail_urlNoSmall image shown in the top-right corner.
footerNo
image_urlNo
timestampNoIf true, adds the current timestamp to the embed.

Implementation Reference

  • Handler for discord_send_dm_embed — fetches the user, builds an embed from args, and sends it as a DM.
    case "discord_send_dm_embed": {
      const user = await discord.users.fetch(validateId(args.user_id, "user_id"));
      const embed = buildEmbed(args);
      const sent = await user.send({
        content: (args.content as string) || undefined,
        embeds: [embed],
      });
      return { content: [{ type: "text", text: `✅ DM embed sent to ${user.username} (message id: ${sent.id}).` }] };
    }
  • Schema definition for discord_send_dm_embed — defines the name, description, and input schema (user_id, optional content, and all embed properties).
    {
      name: "discord_send_dm_embed",
      description:
        "Send a rich embed as a direct message to a user.",
      inputSchema: {
        type: "object",
        properties: {
          ...userIdProp,
          content: { type: "string", description: "Optional text content above the embed." },
          ...embedProperties,
        },
        required: ["user_id"],
      },
    },
  • Registration of the dm module in the central tool registry — imports and adds the dm module to the modules array, making discord_send_dm_embed available for routing.
    import dm from "./dm.js";
    
    const modules: ToolModule[] = [
      discovery,
      messages,
      channels,
      permissions,
      members,
      roles,
      moderation,
      screening,
      stats,
      forums,
      webhooks,
      scheduledEvents,
      invites,
      dm,
    ];
  • buildEmbed helper — constructs a Discord.js EmbedBuilder from flat arguments, used by discord_send_dm_embed to create the embed.
    function buildEmbed(args: Record<string, unknown>): EmbedBuilder {
      const embed = new EmbedBuilder();
      if (args.title) embed.setTitle(args.title as string);
      if (args.url) embed.setURL(args.url as string);
      if (args.description) embed.setDescription(args.description as string);
      if (args.color) embed.setColor(args.color as ColorResolvable);
      if (args.footer) embed.setFooter({ text: args.footer as string });
      if (args.image_url) embed.setImage(args.image_url as string);
      if (args.thumbnail_url) embed.setThumbnail(args.thumbnail_url as string);
      if (args.timestamp) embed.setTimestamp();
      if (args.author) {
        const a = args.author as { name: string; icon_url?: string; url?: string };
        embed.setAuthor({ name: a.name, iconURL: a.icon_url, url: a.url });
      }
      if (args.fields) {
        const fields = args.fields as { name: string; value: string; inline?: boolean }[];
        embed.addFields(fields.map((f) => ({ name: f.name, value: f.value, inline: f.inline ?? false })));
      }
      return embed;
    }
  • embedProperties — shared schema properties for embed fields (title, url, description, color, fields, author, thumbnail_url, footer, image_url, timestamp), used by discord_send_dm_embed input schema.
    const embedProperties = {
      title: { type: "string" },
      url: { type: "string", description: "URL that makes the title clickable." },
      description: { type: "string" },
      color: { type: "string", description: "Hex color e.g. #5865F2" },
      fields: {
        type: "array",
        items: {
          type: "object",
          properties: {
            name: { type: "string" },
            value: { type: "string" },
            inline: { type: "boolean" },
          },
          required: ["name", "value"],
        },
      },
      author: {
        type: "object",
        description: "Author block shown at the top of the embed.",
        properties: {
          name: { type: "string" },
          icon_url: { type: "string" },
          url: { type: "string" },
        },
        required: ["name"],
      },
      thumbnail_url: { type: "string", description: "Small image shown in the top-right corner." },
      footer: { type: "string" },
      image_url: { type: "string" },
      timestamp: { type: "boolean", description: "If true, adds the current timestamp to the embed." },
    } as const;
Behavior2/5

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

No annotations exist, and the description does not disclose permissions, side effects, or error cases for sending an embed DM.

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?

Single sentence, front-loaded with key action and target, no redundancy.

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?

Complex tool with 12 parameters and nested objects, but description omits output, error handling, permission requirements, and interaction with sibling tools.

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

Parameters2/5

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

Schema coverage is 58%, but the description adds no parameter details; parameters like 'footer' and 'image_url' lack schema descriptions and are not clarified.

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 sends a 'rich embed as a direct message', distinguishing it from the plain text DM sending sibling tool discord_send_dm.

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?

No guidance on when to use this tool versus other DM tools, no prerequisites or exclusions mentioned.

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