Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_send_webhook_message

Send messages to Discord channels using webhooks for automated notifications and bot integration.

Instructions

Sends a message to a Discord channel using a webhook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhookIdYes
webhookTokenYes
contentYes
usernameNo
avatarURLNo
threadIdNo

Implementation Reference

  • Handler function in the tool execution switch statement. Parses arguments with Zod schema, fetches Discord webhook using client.fetchWebhook, sends message via webhook.send with provided parameters, handles errors and client readiness.
    case "discord_send_webhook_message": {
      const { webhookId, webhookToken, content, username, avatarURL, threadId } = SendWebhookMessageSchema.parse(args);
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }],
            isError: true
          };
        }
    
        const webhook = await 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: content,
          username: username,
          avatarURL: avatarURL,
          threadId: threadId
        });
    
        return {
          content: [{ 
            type: "text", 
            text: `Successfully sent webhook message to webhook ID: ${webhookId}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to send webhook message: ${error}` }],
          isError: true
        };
      }
    }
  • Zod input schema for validating tool arguments: requires webhookId, webhookToken, content; optional username, avatarURL, threadId.
    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()
    });
  • src/index.ts:414-428 (registration)
    Tool registration object in the ListTools handler's tools array, defining name, description, and JSON input schema matching the Zod schema.
      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"]
      }
    },
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 ('sends a message') but lacks details on permissions required, rate limits, error handling, or what happens upon success (e.g., message ID returned). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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, clear sentence with zero wasted words—it directly states the tool's function without redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 the complexity (a mutation tool with 6 parameters, 3 required), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on behavioral traits, parameter meanings, usage context, and expected outcomes, making it inadequate for safe and effective tool invocation.

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 description coverage is 0%, so the schema provides no parameter details. The description adds no information about parameters beyond implying webhookId and webhookToken are needed (from 'using a webhook'), but it doesn't explain their purpose, format, or how to obtain them, nor does it cover optional parameters like username or threadId. This fails to compensate for the low schema coverage.

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 a message') and target ('to a Discord channel using a webhook'), which is specific and distinguishes it from sibling tools like discord_send (which likely uses different authentication) and discord_create_webhook (which creates rather than uses a webhook). However, it doesn't explicitly differentiate from all siblings, such as discord_reply_to_forum, which might also send messages in a different context.

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. It doesn't mention prerequisites (e.g., needing a pre-existing webhook), compare it to discord_send (which may use bot tokens instead), or specify scenarios like sending to specific channels or threads. This leaves the agent with minimal context for tool selection.

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

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