Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_list_guilds

Retrieve all Discord servers accessible to the bot, enabling server management and overview within the MCP-Discord platform.

Instructions

Lists all Discord servers (guilds) the bot has access to

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'discord_list_guilds' tool that lists all Discord guilds (servers) the bot has access to, including their IDs, names, member counts, and channels.
    case "discord_list_guilds": {
      ListGuildsSchema.parse(args);
      
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }],
            isError: true
          };
        }
        
        // Get all guilds the bot is in
        const guilds = client.guilds.cache.map(guild => ({
          id: guild.id,
          name: guild.name,
          memberCount: guild.memberCount,
          channels: guild.channels.cache.map(channel => ({
            id: channel.id,
            name: channel.name,
            type: channel.type
          }))
        }));
        
        if (guilds.length === 0) {
          return {
            content: [{ type: "text", text: "The bot is not a member of any Discord servers." }]
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: `Available Discord Servers:\n${JSON.stringify(guilds, null, 2)}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to list guilds: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema for input validation of the 'discord_list_guilds' tool, which requires no parameters.
    const ListGuildsSchema = z.object({});
  • src/index.ts:206-213 (registration)
    Tool registration in the listTools response, defining name, description, and input schema for 'discord_list_guilds'.
    {
      name: "discord_list_guilds",
      description: "Lists all Discord servers (guilds) the bot has access to",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'the bot has access to' which hints at permission/scope constraints, but lacks details on rate limits, pagination, response format, or error conditions. For a read operation with zero annotation coverage, this is insufficient.

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 directly states the tool's purpose without redundancy. It's front-loaded with the core action and resource, making it easy to parse quickly. No wasted words or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but minimal. It covers the basic purpose but lacks behavioral context that would help an agent understand how to interpret results or handle edge cases. For a list operation, more detail on response structure would be beneficial.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description appropriately doesn't add parameter details beyond what's in the schema, maintaining alignment. Baseline for 0 parameters is 4.

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 verb ('Lists') and resource ('Discord servers (guilds)'), specifying what the tool does. It distinguishes from siblings by focusing on guild listing rather than message/channel/webhook operations, though it doesn't explicitly contrast with 'discord_get_server_info' which might have overlapping scope.

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 like 'discord_get_server_info' or other guild-related operations. The description only states what it does without context about prerequisites, timing, or comparison to sibling tools.

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

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