Skip to main content
Glama

discord_send_webhook_message

Send messages to Discord channels using webhook credentials, with options for custom content, usernames, avatars, and rich embeds.

Instructions

Send a message via a webhook using its ID and token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhook_idYes
webhook_tokenYes
contentNoText content of the message.
usernameNoOverride the webhook's default username.
avatar_urlNoOverride the webhook's default avatar.
embedsNoOptional array of embed objects.

Implementation Reference

  • Handler logic for the discord_send_webhook_message tool, which constructs a WebhookClient and sends a message with optional content and embeds.
    case "discord_send_webhook_message": {
      const webhookId = validateId(args.webhook_id, "webhook_id");
      const token = args.webhook_token as string;
      if (!token) throw new Error("webhook_token is required.");
      const client = new WebhookClient({ id: webhookId, token });
      try {
        const sendOptions: Record<string, unknown> = {};
        if (args.content) sendOptions.content = args.content as string;
        if (args.username) sendOptions.username = args.username as string;
        if (args.avatar_url) sendOptions.avatarURL = args.avatar_url as string;
        if (args.embeds) {
          const embedArgs = args.embeds as Record<string, unknown>[];
          if (embedArgs.length > 10) throw new Error("Discord allows a maximum of 10 embeds per message.");
          sendOptions.embeds = embedArgs.map((e) => buildWebhookEmbed(e));
        }
        if (!sendOptions.content && !sendOptions.embeds) {
          throw new Error("At least one of content or embeds is required.");
        }
        const sent = await client.send(sendOptions);
        return { content: [{ type: "text", text: `✅ Webhook message sent (id: ${sent.id}).` }] };
      } finally {
        client.destroy();
      }
    }
  • Input schema definition for the discord_send_webhook_message tool.
    {
      name: "discord_send_webhook_message",
      description: "Send a message via a webhook using its ID and token.",
      inputSchema: {
        type: "object",
        properties: {
          webhook_id: { type: "string" },
          webhook_token: { type: "string" },
          content: { type: "string", description: "Text content of the message." },
          username: { type: "string", description: "Override the webhook's default username." },
          avatar_url: { type: "string", description: "Override the webhook's default avatar." },
          embeds: {
            type: "array",
            description: "Optional array of embed objects.",
            items: {
              type: "object",
              properties: {
                title: { type: "string" },
                url: { type: "string" },
                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"],
                  },
                },
                footer: { type: "string" },
                image_url: { type: "string" },
                thumbnail_url: { type: "string" },
                timestamp: { type: "boolean" },
              },
            },
          },
        },
        required: ["webhook_id", "webhook_token"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is to 'send a message,' implying a write operation, but doesn't cover important aspects like rate limits, authentication requirements beyond the token, whether the message is ephemeral or persistent, or potential side effects (e.g., triggering notifications).

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 with no wasted words. It's front-loaded with the core action and mechanism, making it easy to understand at a glance.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain the return value (e.g., message ID or success confirmation), error conditions, or how parameters like embeds interact with content. Given the complexity and lack of structured data, more detail is needed.

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?

The description mentions the required parameters (webhook ID and token) but doesn't add meaning beyond what the schema provides. With 67% schema description coverage (4 out of 6 parameters have descriptions), the baseline is 3. The description doesn't compensate for the lack of schema descriptions for webhook_id and webhook_token, nor does it explain the relationship between parameters like content and embeds.

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 ('Send a message') and the mechanism ('via a webhook using its ID and token'), which distinguishes it from sibling tools like discord_send_message or discord_send_embed that use different sending methods. However, it doesn't explicitly differentiate from discord_send_multiple_embeds, which might also use webhooks.

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 like discord_send_message (which might use channel IDs instead of webhooks) or other webhook-related tools. It mentions the required parameters but doesn't explain the context or prerequisites for using webhooks.

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