Skip to main content
Glama

discord_edit_webhook

Modify an existing Discord webhook's name, avatar, or channel to update automated message delivery settings.

Instructions

Edits an existing webhook for a Discord channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhookIdYes
webhookTokenNo
nameNo
avatarNo
channelIdNo
reasonNo

Implementation Reference

  • The main handler function for 'discord_edit_webhook' tool. It validates input using EditWebhookSchema, fetches the webhook using Discord client, edits it with provided parameters, 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,
          avatar,
          channel: channelId,
          reason,
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully edited webhook with ID: ${webhook.id}`,
            },
          ],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    }
  • Zod schema defining the input parameters and validation for the discord_edit_webhook tool.
    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(),
    });
  • Registration entry for the tool including name, description, and JSON schema compatible input schema, likely used in MCP tools/list response.
    {
      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:199-202 (registration)
    Dispatch/registration case in server.ts that calls the editWebhookHandler upon tool invocation.
    case 'discord_edit_webhook':
      this.logClientState('before discord_edit_webhook handler');
      toolResponse = await editWebhookHandler(args, this.toolContext);
      return toolResponse;
  • Dispatch case in transport.ts HTTP handler that routes 'discord_edit_webhook' to editWebhookHandler.
    case 'discord_edit_webhook':
      result = await editWebhookHandler(params, this.toolContext!);
      break;
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. It states the tool edits a webhook, implying mutation, but doesn't cover permissions needed, rate limits, whether changes are reversible, or what the response looks like. This is a significant gap for a mutation tool 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, efficient sentence that front-loads the core action and resource without unnecessary words. It earns its place by being direct, though it could benefit from additional context to improve other dimensions.

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 of a 6-parameter mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, parameter meanings, and expected outcomes, making it inadequate for an agent to use the tool effectively without guessing.

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 for all 6 parameters. It only mentions editing a webhook without explaining what parameters like 'webhookId', 'webhookToken', 'name', 'avatar', 'channelId', or 'reason' do, leaving their semantics undocumented. This fails to add meaningful value beyond the bare schema.

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 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 editing entails versus creating or deleting.

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 such as 'discord_create_webhook' or 'discord_delete_webhook'. The description implies usage for editing webhooks but lacks context on prerequisites, scenarios, or exclusions, leaving the agent to infer based on tool names alone.

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

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