Skip to main content
Glama

discord_edit_webhook

Edit a Discord webhook by changing its name, avatar, or channel assignment. Requires webhook ID and optional token for authentication.

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'. It fetches the webhook by ID (and optional token), then calls webhook.edit() with optional name, avatar, channelId, and reason. Returns a success or error response.
    // Edit webhook handler
    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 (EditWebhookSchema) defining validation for the edit webhook input: webhookId (required), webhookToken, name, avatar, channelId, and reason (all optional).
    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 of 'discord_edit_webhook' in the tool list with its description and input schema. Required field is only webhookId.
    {
      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)
    Server-side dispatch: routes the 'discord_edit_webhook' tool call to editWebhookHandler.
    case 'discord_edit_webhook':
      this.logClientState('before discord_edit_webhook handler');
      toolResponse = await editWebhookHandler(args, this.toolContext);
      return toolResponse;
  • Transport-level dispatch in the StreamableHttpTransport: routes the 'discord_edit_webhook' tool call to editWebhookHandler.
    case 'discord_edit_webhook':
      result = await editWebhookHandler(toolArgs, this.toolContext!);
      break;
Behavior2/5

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

No annotations are provided, so description carries full burden. It states it 'edits' but does not disclose what happens on failure, permission requirements, or scope of changes (e.g., avatar update behavior).

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

Conciseness3/5

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

Single sentence is concise, but it lacks any structure or additional context. It could include more information without being verbose (e.g., typical use cases).

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?

With 6 parameters (1 required), no output schema, and no description of return value or side effects, the description is insufficient for an agent to use the tool confidently.

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%, and description adds no meaning beyond listing 'Edits'. Parameters like avatar, reason, and channelId are not explained in context (e.g., channelId may change webhook target).

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

Purpose5/5

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

Description clearly states verb 'Edits' and resource 'existing webhook for a Discord channel'. It distinguishes from sibling tools like discord_create_webhook and discord_delete_webhook.

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?

Description provides no guidance on when to use this tool vs alternatives (e.g., when to create vs edit), no prerequisites, and no conditions that would make it inappropriate.

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