Skip to main content
Glama
scarecr0w12

discord-mcp

delete_webhook

Remove a Discord webhook by its ID to stop automated messages or manage integrations. Specify a reason for deletion when needed.

Instructions

Delete a webhook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhookIdYesThe ID of the webhook
reasonNoReason for deleting

Implementation Reference

  • The handler function for the delete_webhook tool. It fetches the webhook using the Discord client and deletes it, handling errors with withErrorHandling and returning formatted success/error responses.
    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) }] };
    }
  • Zod schema defining the input parameters for the delete_webhook tool: required webhookId and optional reason.
    {
      webhookId: z.string().describe('The ID of the webhook'),
      reason: z.string().optional().describe('Reason for deleting'),
    },
  • Registration of the delete_webhook tool using server.tool(), including name, description, input schema, and handler function within the registerWebhookTools 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) }] };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Delete a webhook' implies a destructive, irreversible operation, but it doesn't specify required permissions, whether deletion is permanent, what happens to associated data, or error conditions. For a destructive tool with zero annotation coverage, this leaves critical behavioral traits undisclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, with zero wasted language. It's front-loaded with the core action and resource, making it immediately scannable and efficient. Every word earns its place by conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a destructive operation with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after deletion, potential side effects, permission requirements, or error handling. For a tool that permanently removes resources, this level of minimalism creates significant gaps in understanding for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters (webhookId and reason) clearly documented in the schema. The description adds no additional parameter information beyond what's already in the structured schema. According to scoring rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Delete a webhook' clearly states the verb (delete) and resource (webhook), making the purpose immediately understandable. However, it doesn't distinguish this tool from other deletion tools like delete_channel or delete_message, which would require mentioning what makes webhook deletion unique.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (like needing a webhook ID), when deletion is appropriate, or what happens after deletion. With sibling tools like modify_webhook and create_webhook available, the lack of comparative context is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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