Skip to main content
Glama

delete_webhook

Remove a Discord webhook by ID to stop automated messages or integrations, optionally specifying a reason for deletion.

Instructions

Delete a webhook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhookIdYesThe ID of the webhook
reasonNoReason for deleting

Implementation Reference

  • The main execution logic for the delete_webhook tool: fetches the webhook using Discord client, deletes it with optional reason, handles errors, and formats response.
    async ({ webhookId, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const webhook = await client.fetchWebhook(webhookId); const webhookName = webhook.name; await webhook.delete(reason); return { webhookId, webhookName, message: 'Webhook deleted successfully' }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; }
  • Input schema using Zod: requires webhookId string, optional reason string.
    { webhookId: z.string().describe('The ID of the webhook'), reason: z.string().optional().describe('Reason for deleting'), },
  • Registers the delete_webhook tool on the MCP server instance with name, description, input schema, and handler function.
    server.tool( 'delete_webhook', 'Delete a webhook', { webhookId: z.string().describe('The ID of the webhook'), reason: z.string().optional().describe('Reason for deleting'), }, async ({ webhookId, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const webhook = await client.fetchWebhook(webhookId); const webhookName = webhook.name; await webhook.delete(reason); return { webhookId, webhookName, message: 'Webhook deleted successfully' }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } );
  • src/index.ts:60-60 (registration)
    Top-level registration call that invokes registerWebhookTools to add all webhook tools, including delete_webhook, to the MCP server.
    registerWebhookTools(server);

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/scarecr0w12/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server