discord_create_webhook
Create a webhook in a Discord channel to automate message delivery and integrate external services.
Instructions
Create a webhook on a channel.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| name | Yes | Name for the webhook. | |
| avatar | No | Optional avatar URL for the webhook. |
Implementation Reference
- src/tools/webhooks.ts:126-139 (handler)The handler logic for 'discord_create_webhook' which fetches the channel, checks for webhook support, and creates the webhook.
case "discord_create_webhook": { const channel = await discord.channels.fetch(validateId(args.channel_id, "channel_id")); if (!channel || !("createWebhook" in channel)) throw new Error("Channel does not support webhooks."); const webhook = await (channel as any).createWebhook({ name: args.name as string, avatar: (args.avatar as string | undefined) ?? undefined, }); return { content: [{ type: "text", text: `✅ Webhook "${webhook.name}" created (id: ${webhook.id}, token: ${webhook.token}).`, }], }; } - src/tools/webhooks.ts:7-19 (schema)The MCP schema definition for the 'discord_create_webhook' tool.
{ name: "discord_create_webhook", description: "Create a webhook on a channel.", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, name: { type: "string", description: "Name for the webhook." }, avatar: { type: "string", description: "Optional avatar URL for the webhook." }, }, required: ["channel_id", "name"], }, },