Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_delete_webhook

Delete a specific Discord webhook using its ID and token to manage channel integrations effectively. Supports providing a reason for deletion.

Instructions

Deletes an existing webhook for a Discord channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNo
webhookIdYes
webhookTokenNo

Implementation Reference

  • src/index.ts:445-457 (registration)
    Registration of the 'discord_delete_webhook' tool in the MCP server's tool list, including name, description, and input schema.
    { 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"] } }
  • Zod schema definition for input parameters validation of the 'discord_delete_webhook' tool.
    const DeleteWebhookSchema = z.object({ webhookId: z.string(), webhookToken: z.string().optional(), reason: z.string().optional() });
  • Handler function for 'discord_delete_webhook' tool that parses arguments, checks client readiness, fetches the webhook using Discord.js, and deletes it.
    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 }; } }

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