Skip to main content
Glama
scarecr0w12

discord-mcp

list_guild_webhooks

Retrieve all configured webhooks within a Discord server to manage automated message delivery and integrations.

Instructions

List all webhooks in a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)

Implementation Reference

  • Executes the tool logic: fetches the guild, retrieves all webhooks using guild.fetchWebhooks(), maps them to a simplified object, wraps in error handling, and returns JSON string.
    async ({ guildId }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const webhooks = await guild.fetchWebhooks();
    
        return webhooks.map((wh) => ({
          id: wh.id,
          name: wh.name,
          type: wh.type,
          channelId: wh.channelId,
          avatar: wh.avatar,
          owner: wh.owner ? { id: wh.owner.id, username: wh.owner.username } : null,
          createdAt: wh.createdAt?.toISOString(),
        }));
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Zod input schema defining the required guildId parameter.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
    },
  • Registers the list_guild_webhooks tool on the MCP server with name, description, input schema, and handler function.
    server.tool(
      'list_guild_webhooks',
      'List all webhooks in a server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
      },
      async ({ guildId }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const webhooks = await guild.fetchWebhooks();
    
          return webhooks.map((wh) => ({
            id: wh.id,
            name: wh.name,
            type: wh.type,
            channelId: wh.channelId,
            avatar: wh.avatar,
            owner: wh.owner ? { id: wh.owner.id, username: wh.owner.username } : null,
            createdAt: wh.createdAt?.toISOString(),
          }));
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • src/index.ts:61-61 (registration)
    Top-level call to registerWebhookTools which includes the list_guild_webhooks tool.
    registerWebhookTools(server);
  • src/index.ts:18-18 (registration)
    Import of registerWebhookTools function that defines and registers the tool.
    import { registerWebhookTools } from './tools/webhook-tools.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'List all' implies a read-only operation, it doesn't specify whether this requires specific permissions, how results are returned (e.g., pagination, format), or any rate limits. For a 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 with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's purpose.

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 lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like permissions, response format, or error handling, which are crucial for a tool that interacts with server data. For a tool with no structured safety or output information, the description should provide more context to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'guildId' clearly documented in the schema as 'The ID of the server (guild)'. The description adds no additional parameter information beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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 ('List all') and resource ('webhooks in a server'), making the purpose immediately understandable. It distinguishes from siblings like 'create_webhook' and 'delete_webhook' by focusing on retrieval rather than modification. However, it doesn't explicitly differentiate from 'list_channel_webhooks', which might be a more specific alternative.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list_channel_webhooks' or other list tools. It doesn't mention prerequisites, such as needing server access, or exclusions, such as not filtering by channel. This leaves the agent with minimal context for tool selection.

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

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