Skip to main content
Glama
jar285

MCP-Discord

by jar285

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
NameRequiredDescriptionDefault
webhookIdYes
webhookTokenNo
reasonNo

Implementation Reference

  • 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
        };
      }
    }
  • 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"]
      }
    }

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