discord_delete_webhook
Delete Discord webhooks to remove automated message sources from channels, manage integrations, and maintain channel organization.
Instructions
Deletes an existing webhook for a Discord channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| webhookId | Yes | ||
| webhookToken | No | ||
| reason | No |
Implementation Reference
- src/index.ts:1347-1380 (handler)Handler function for discord_delete_webhook tool. Parses arguments, fetches the webhook using Discord client, deletes it, and returns success or error response.case "discord_delete_webhook": { const { webhookId, webhookToken, reason } = DeleteWebhookSchema.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 }; } // Delete the webhook await webhook.delete(reason || "Webhook deleted via API"); return { content: [{ type: "text", text: `Successfully deleted webhook with ID: ${webhook.id}` }] }; } catch (error) { return { content: [{ type: "text", text: `Failed to delete webhook: ${error}` }], isError: true }; } }
- src/index.ts:146-150 (schema)Zod schema for input validation of discord_delete_webhook tool parameters: webhookId (required), webhookToken (optional), reason (optional).const DeleteWebhookSchema = z.object({ webhookId: z.string(), webhookToken: z.string().optional(), reason: z.string().optional() });
- src/index.ts:445-457 (registration)Tool registration in the list of available tools, including name, description, and input schema definition.{ name: "discord_delete_webhook", description: "Deletes an existing webhook for a Discord channel", inputSchema: { type: "object", properties: { webhookId: { type: "string" }, webhookToken: { type: "string" }, reason: { type: "string" } }, required: ["webhookId"] } }