Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_create_webhook

Create a Discord webhook to automate message delivery and integrate external services with specific channels, enabling automated notifications and data flow.

Instructions

Creates a new webhook for a Discord channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
nameYes
avatarNo
reasonNo

Implementation Reference

  • The switch case handler that executes the discord_create_webhook tool. It validates input using CreateWebhookSchema, fetches the channel, creates a webhook using channel.createWebhook(), and returns the webhook ID and token on success.
    case "discord_create_webhook": {
      const { channelId, name, avatar, reason } = CreateWebhookSchema.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 channel = await client.channels.fetch(channelId);
        if (!channel || !channel.isTextBased()) {
          return {
            content: [{ type: "text", text: `Cannot find text channel with ID: ${channelId}` }],
            isError: true
          };
        }
    
        // Check if the channel supports webhooks
        if (!('createWebhook' in channel)) {
          return {
            content: [{ type: "text", text: `Channel type does not support webhooks: ${channelId}` }],
            isError: true
          };
        }
    
        // Create the webhook
        const webhook = await channel.createWebhook({
          name: name,
          avatar: avatar,
          reason: reason
        });
    
        return {
          content: [{ 
            type: "text", 
            text: `Successfully created webhook with ID: ${webhook.id} and token: ${webhook.token}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to create webhook: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the discord_create_webhook tool: channelId (required), name (required), avatar (optional), reason (optional). Used for validation in the handler.
    const CreateWebhookSchema = z.object({
        channelId: z.string(),
        name: z.string(),
        avatar: z.string().optional(),
        reason: z.string().optional()
    });
  • src/index.ts:399-411 (registration)
    Tool registration in the MCP server's listTools response. Specifies the tool name, description, and inputSchema matching the CreateWebhookSchema.
    {
      name: "discord_create_webhook",
      description: "Creates a new webhook for a Discord channel",
      inputSchema: {
        type: "object",
        properties: {
          channelId: { type: "string" },
          name: { type: "string" },
          avatar: { type: "string" },
          reason: { type: "string" }
        },
        required: ["channelId", "name"]
      }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'creates' implies a write/mutation operation, it doesn't describe what happens after creation (e.g., returns webhook URL/token), permission requirements, rate limits, or whether the operation is idempotent. For a creation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 that states the core purpose without unnecessary words. It's appropriately sized for a basic creation operation and front-loads the essential information. Every word earns its place.

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 creation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns (webhook object/URL), parameter semantics, or behavioral context like permissions. The agent lacks sufficient information to use this tool correctly without external knowledge.

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 documentation. The description adds no information about any parameters—it doesn't explain what 'channelId', 'name', 'avatar', or 'reason' mean, their formats, or constraints. With 4 parameters (2 required) completely undocumented, the description fails to compensate for the schema's lack of documentation.

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 ('creates') and resource ('new webhook for a Discord channel'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'discord_edit_webhook' or 'discord_delete_webhook', but the verb 'creates' distinguishes it from those modification/deletion operations.

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 (like needing channel access), when not to use it, or how it differs from related tools like 'discord_send_webhook_message' (which uses existing webhooks). The agent must infer usage from the name alone.

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