Skip to main content
Glama

discord_send_webhook_message

Send a message to a Discord channel through a webhook. Customize content, username, avatar, or thread ID for targeted notifications.

Instructions

Sends a message to a Discord channel using a webhook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhookIdYes
webhookTokenYes
contentYes
usernameNo
avatarURLNo
threadIdNo

Implementation Reference

  • The main handler function that sends a message via Discord webhook. Parses args with SendWebhookMessageSchema, fetches the webhook, and sends the message with content, username, avatarURL, and threadId.
    // Send webhook message handler
    export async function sendWebhookMessageHandler(
      args: unknown,
      context: ToolContext
    ): Promise<ToolResponse> {
      const { webhookId, webhookToken, content, username, avatarURL, threadId } =
        SendWebhookMessageSchema.parse(args);
      try {
        if (!context.client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const webhook = await context.client.fetchWebhook(webhookId, webhookToken);
        if (!webhook) {
          return {
            content: [
              { type: 'text', text: `Cannot find webhook with ID: ${webhookId}` },
            ],
            isError: true,
          };
        }
    
        // Send the message
        await webhook.send({
          content,
          username,
          avatarURL,
          threadId,
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully sent webhook message to webhook ID: ${webhookId}`,
            },
          ],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    }
  • Zod schema defining input validation for sendWebhookMessage: webhookId (string), webhookToken (string), content (string), and optional username, avatarURL, threadId.
    export const SendWebhookMessageSchema = z.object({
      webhookId: z.string(),
      webhookToken: z.string(),
      content: z.string(),
      username: z.string().optional(),
      avatarURL: z.string().optional(),
      threadId: z.string().optional(),
    });
  • Tool registration entry defining the tool name 'discord_send_webhook_message', description, inputSchema with required fields webhookId, webhookToken, and content.
    {
      name: 'discord_send_webhook_message',
      description: 'Sends a message to a Discord channel using a webhook',
      inputSchema: {
        type: 'object',
        properties: {
          webhookId: { type: 'string' },
          webhookToken: { type: 'string' },
          content: { type: 'string' },
          username: { type: 'string' },
          avatarURL: { type: 'string' },
          threadId: { type: 'string' },
        },
        required: ['webhookId', 'webhookToken', 'content'],
      },
  • Re-exports the sendWebhookMessageHandler from webhooks.ts as a barrel export.
    export { ToolContext, ToolHandler, ToolResponse } from './types.js';
    export {
      createWebhookHandler,
      deleteWebhookHandler,
      editWebhookHandler,
      sendWebhookMessageHandler,
    } from './webhooks.js';
  • src/server.ts:191-197 (registration)
    Server route dispatch: maps the 'discord_send_webhook_message' case to calling sendWebhookMessageHandler(args, toolContext).
    case 'discord_send_webhook_message':
      this.logClientState('before discord_send_webhook_message handler');
      toolResponse = await sendWebhookMessageHandler(
        args,
        this.toolContext
      );
      return toolResponse;
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the basic function without mentioning webhook authorization requirements, rate limits, message formatting, 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.

Conciseness3/5

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

The description is very concise (one sentence), which is good for front-loading, but it is under-specified. It could be improved by adding brief parameter guidance without being overly verbose.

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?

With 6 parameters, no annotations, and no output schema, the description is insufficient. It fails to explain key aspects like what a webhook is, how to construct parameters, or what the response looks like.

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 0%, meaning no parameter descriptions in the schema. The description adds no meaning beyond parameter names. It mentions 'webhook' broadly but doesn't explain what webhookId, webhookToken, or other parameters represent or how to obtain them.

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 (sends), resource (message), and method (webhook). However, it doesn't distinguish itself from the sibling tool 'discord_send', which likely has similar functionality.

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 provided on when to use this tool versus alternatives like discord_send or other message-related tools. No prerequisites or context for usage.

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

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