Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_edit_webhook

Modify an existing Discord webhook to update its name, avatar, or channel ID. Use this tool to manage webhook configurations within the MCP-Discord server for efficient integration and communication.

Instructions

Edits an existing webhook for a Discord channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
avatarNo
channelIdNo
nameNo
reasonNo
webhookIdYes
webhookTokenNo

Implementation Reference

  • Handler function that executes the discord_edit_webhook tool. Fetches the webhook using client.fetchWebhook, parses arguments with EditWebhookSchema, edits the webhook using webhook.edit, handles errors and client readiness.
    case "discord_edit_webhook": { const { webhookId, webhookToken, name, avatar, channelId, reason } = EditWebhookSchema.parse(args); try { if (!client.isReady()) { return { content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }], isError: true }; } const webhook = await 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 { content: [{ type: "text", text: `Failed to edit webhook: ${error}` }], isError: true }; } }
  • Zod schema for input validation of discord_edit_webhook tool parameters: webhookId (required), optional webhookToken, name, avatar, channelId, reason.
    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() });
  • src/index.ts:429-443 (registration)
    Tool registration in the ListToolsRequestHandler response, defining name, description, and inputSchema for discord_edit_webhook.
    { 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"] }

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

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