Skip to main content
Glama

discord_list_webhooks

List all webhooks for a specific Discord channel or entire guild to manage automated message delivery and integrations.

Instructions

List all webhooks for a channel or guild. Provide either channel_id or guild_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idNoList webhooks for a specific channel.
guild_idNoList all webhooks in a guild.

Implementation Reference

  • The implementation logic for "discord_list_webhooks" inside the 'handle' function, which fetches webhooks from either a channel or a guild.
    case "discord_list_webhooks": {
      if (args.channel_id) {
        const channel = await discord.channels.fetch(validateId(args.channel_id, "channel_id"));
        if (!channel || !("fetchWebhooks" in channel)) throw new Error("Channel does not support webhooks.");
        const webhooks = await (channel as any).fetchWebhooks();
        const result = [...webhooks.values()].map((w: any) => ({
          id: w.id,
          name: w.name,
          channel_id: w.channelId,
          token: w.token ?? null,
          creator: w.owner?.tag ?? null,
        }));
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } else if (args.guild_id) {
        const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
        const webhooks = await guild.fetchWebhooks();
        const result = [...webhooks.values()].map((w) => ({
          id: w.id,
          name: w.name,
          channel_id: w.channelId,
          token: w.token ?? null,
          creator: w.owner && "tag" in w.owner ? w.owner.tag : (w.owner?.username ?? null),
        }));
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } else {
        throw new Error("Either channel_id or guild_id is required.");
      }
  • The tool definition/registration for "discord_list_webhooks" including the input schema.
    {
      name: "discord_list_webhooks",
      description: "List all webhooks for a channel or guild. Provide either channel_id or guild_id.",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: { type: "string", description: "List webhooks for a specific channel." },
          guild_id: { type: "string", description: "List all webhooks in a guild." },
        },
      },
    },

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

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