discord_edit_webhook
Modify an existing Discord webhook's name, avatar, or channel by providing its ID and token. This tool enables updating webhook configurations for automated messaging workflows.
Instructions
Edits an existing webhook for a Discord channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| webhookId | Yes | ||
| webhookToken | No | ||
| name | No | ||
| avatar | No | ||
| channelId | No | ||
| reason | No |
Implementation Reference
- src/index.ts:1307-1345 (handler)The handler for discord_edit_webhook tool. Parses arguments using EditWebhookSchema, fetches the webhook using client.fetchWebhook, and calls webhook.edit with the provided options.case "discord_edit_webhook": { const { webhookId, webhookToken, name, avatar, channelId, reason } = EditWebhookSchema.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 }; } // Edit the webhook await webhook.edit({ name: name, avatar: avatar, channel: channelId, reason: reason }); return { content: [{ type: "text", text: `Successfully edited webhook with ID: ${webhook.id}` }] }; } catch (error) { return { content: [{ type: "text", text: `Failed to edit webhook: ${error}` }], isError: true }; } }
- src/index.ts:137-144 (schema)Zod input schema definition for the discord_edit_webhook tool parameters.const EditWebhookSchema = z.object({ webhookId: z.string(), webhookToken: z.string().optional(), name: z.string().optional(), avatar: z.string().optional(), channelId: z.string().optional(), reason: z.string().optional() });
- src/index.ts:429-444 (registration)Registration of the discord_edit_webhook tool in the list of available tools returned by ListToolsRequestHandler, including the input schema.{ name: "discord_edit_webhook", description: "Edits an existing webhook for a Discord channel", inputSchema: { type: "object", properties: { webhookId: { type: "string" }, webhookToken: { type: "string" }, name: { type: "string" }, avatar: { type: "string" }, channelId: { type: "string" }, reason: { type: "string" } }, required: ["webhookId"] } },