Skip to main content
Glama

discord_delete_webhook

Remove an existing Discord webhook by specifying its ID and token. This tool ensures unwanted or outdated webhooks are deleted from your Discord channel efficiently.

Instructions

Deletes an existing webhook for a Discord channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNo
webhookIdYes
webhookTokenNo

Implementation Reference

  • The core handler function that validates input with DeleteWebhookSchema, fetches the webhook using Discord client, and deletes it with optional reason.
    export async function deleteWebhookHandler(
      args: unknown, 
      context: ToolContext
    ): Promise<ToolResponse> {
      const { webhookId, webhookToken, reason } = DeleteWebhookSchema.parse(args);
      try {
        if (!context.client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in." }],
            isError: true
          };
        }
    
        const webhook = await context.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 handleDiscordError(error);
      }
    } 
  • Zod schema for validating the tool inputs: webhookId (required), optional webhookToken and reason.
    export const DeleteWebhookSchema = z.object({
        webhookId: z.string(),
        webhookToken: z.string().optional(),
        reason: z.string().optional()
    });
  • src/server.ts:178-181 (registration)
    Server dispatch switch case that invokes the deleteWebhookHandler with parsed args and tool context.
    case "discord_delete_webhook":
      this.logClientState("before discord_delete_webhook handler");
      toolResponse = await deleteWebhookHandler(args, this.toolContext);
      return toolResponse;
  • MCP tool list entry defining the tool name, description, and JSON schema for input validation.
    {
      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"]
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool deletes a webhook, implying a destructive mutation, but does not cover critical aspects like required permissions, whether the deletion is permanent, rate limits, or error handling. This is a significant gap for a destructive operation with zero annotation coverage.

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 a single, clear sentence that efficiently conveys the core action without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 the tool's complexity (destructive operation with 3 parameters), lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It does not address parameter meanings, behavioral traits, or return values, leaving significant gaps for the agent to understand and invoke the tool correctly.

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

Parameters2/5

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

Schema description coverage is 0%, meaning none of the three parameters (webhookId, webhookToken, reason) are documented in the schema. The description does not mention any parameters or their purposes, failing to compensate for the schema's lack of documentation. This leaves the agent with no semantic understanding of the inputs beyond their names and types.

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 clearly states the action ('Deletes') and target resource ('an existing webhook for a Discord channel'), making the purpose unambiguous. However, it does not explicitly differentiate from sibling tools like discord_delete_channel or discord_delete_message, which also delete Discord resources but different types.

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. It does not mention prerequisites (e.g., needing a webhook ID), exclusions, or compare it to related tools like discord_edit_webhook or discord_create_webhook, leaving usage context implied rather than explicit.

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

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

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