Skip to main content
Glama

discord_edit_webhook

Modifies an existing Discord webhook to update its name, avatar, or channel ID. Enables precise control over webhook configurations for enhanced interaction management.

Instructions

Edits an existing webhook for a Discord channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
avatarNo
channelIdNo
nameNo
reasonNo
webhookIdYes
webhookTokenNo

Implementation Reference

  • The main execution handler for the 'discord_edit_webhook' tool. Validates input arguments using EditWebhookSchema, fetches the webhook from Discord API, edits it with provided name, avatar, channel, or reason, and returns success or error response.
    export async function editWebhookHandler(
      args: unknown, 
      context: ToolContext
    ): Promise<ToolResponse> {
      const { webhookId, webhookToken, name, avatar, channelId, reason } = EditWebhookSchema.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
          };
        }
    
        // Edit the webhook
        await webhook.edit({
          name: name,
          avatar: avatar,
          channel: channelId,
          reason: reason
        });
    
        return {
          content: [{ 
            type: "text", 
            text: `Successfully edited webhook with ID: ${webhook.id}` 
          }]
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    }
  • Zod schema for input validation used in the editWebhookHandler to parse and validate arguments like webhookId, name, avatar, etc.
    export const EditWebhookSchema = z.object({
        webhookId: z.string(),
        webhookToken: z.string().optional(),
        name: z.string().optional(),
        avatar: z.string().optional(),
        channelId: z.string().optional(),
        reason: z.string().optional()
    });
  • JSON schema definition for the 'discord_edit_webhook' tool used for MCP tool registration, defining input properties and requirements.
    name: "discord_edit_webhook",
    description: "Edits an existing webhook for a Discord channel",
    inputSchema: {
      type: "object",
      properties: {
        webhookId: { type: "string" },
        webhookToken: { type: "string" },
        name: { type: "string" },
        avatar: { type: "string" },
        channelId: { type: "string" },
        reason: { type: "string" }
      },
      required: ["webhookId"]
    }
  • src/server.ts:173-176 (registration)
    Dispatch registration in the server tool execution switch statement that calls editWebhookHandler when the tool name matches 'discord_edit_webhook'.
    case "discord_edit_webhook":
      this.logClientState("before discord_edit_webhook handler");
      toolResponse = await editWebhookHandler(args, this.toolContext);
      return toolResponse;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. It mentions editing but doesn't specify required permissions, rate limits, whether changes are reversible, or what the response looks like. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that is front-loaded with the core action and resource. There is no wasted verbiage or redundancy, making it highly concise and well-structured for quick comprehension.

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 complexity (6 parameters, mutation tool), lack of annotations, and no output schema, the description is incomplete. It doesn't cover parameter meanings, behavioral traits, or return values, leaving critical gaps for an AI agent to understand and invoke the tool correctly in context.

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%, so the description must compensate but fails to do so. It doesn't explain any of the 6 parameters (e.g., what 'avatar', 'reason', or 'webhookToken' are used for), leaving their semantics undocumented. The description adds no value beyond the bare schema, which is insufficient given the low coverage.

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 ('Edits') and resource ('an existing webhook for a Discord channel'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'discord_create_webhook' or 'discord_delete_webhook' beyond the verb, missing specific distinctions about what aspects can be edited versus created or deleted.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing webhook), exclusions, or comparisons to sibling tools like 'discord_create_webhook' for initial setup or 'discord_send_webhook_message' for usage. The description implies usage only by stating the action without context.

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