Skip to main content
Glama
scarecr0w12

discord-mcp

get_server_info

Retrieve detailed information about a Discord server by providing its guild ID. This tool helps users access server data for management and analysis purposes.

Instructions

Get detailed information about a specific Discord server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)

Implementation Reference

  • The core handler function that executes the get_server_info tool logic: fetches the Discord guild by ID, gathers detailed info including channels and roles, handles errors with withErrorHandling, and returns JSON-formatted response.
    async ({ guildId }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
    
        // Fetch additional data
        const channels = guild.channels.cache;
        const roles = guild.roles.cache;
    
        return {
          id: guild.id,
          name: guild.name,
          description: guild.description,
          memberCount: guild.memberCount,
          ownerId: guild.ownerId,
          createdAt: guild.createdAt.toISOString(),
          icon: guild.iconURL(),
          banner: guild.bannerURL(),
          verificationLevel: guild.verificationLevel,
          premiumTier: guild.premiumTier,
          premiumSubscriptionCount: guild.premiumSubscriptionCount,
          preferredLocale: guild.preferredLocale,
          systemChannelId: guild.systemChannelId,
          rulesChannelId: guild.rulesChannelId,
          afkChannelId: guild.afkChannelId,
          afkTimeout: guild.afkTimeout,
          features: guild.features,
          channelCount: channels.size,
          roleCount: roles.size,
          channels: channels.map((ch) => ({
            id: ch.id,
            name: ch.name,
            type: ch.type,
          })),
          roles: roles.map((role) => ({
            id: role.id,
            name: role.name,
            color: role.hexColor,
            position: role.position,
          })),
        };
      });
    
      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 as a string.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
    },
  • MCP server.tool registration for 'get_server_info' including description, input schema, and inline handler function.
    server.tool(
      'get_server_info',
      'Get detailed information about a specific Discord 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);
    
          // Fetch additional data
          const channels = guild.channels.cache;
          const roles = guild.roles.cache;
    
          return {
            id: guild.id,
            name: guild.name,
            description: guild.description,
            memberCount: guild.memberCount,
            ownerId: guild.ownerId,
            createdAt: guild.createdAt.toISOString(),
            icon: guild.iconURL(),
            banner: guild.bannerURL(),
            verificationLevel: guild.verificationLevel,
            premiumTier: guild.premiumTier,
            premiumSubscriptionCount: guild.premiumSubscriptionCount,
            preferredLocale: guild.preferredLocale,
            systemChannelId: guild.systemChannelId,
            rulesChannelId: guild.rulesChannelId,
            afkChannelId: guild.afkChannelId,
            afkTimeout: guild.afkTimeout,
            features: guild.features,
            channelCount: channels.size,
            roleCount: roles.size,
            channels: channels.map((ch) => ({
              id: ch.id,
              name: ch.name,
              type: ch.type,
            })),
            roles: roles.map((role) => ({
              id: role.id,
              name: role.name,
              color: role.hexColor,
              position: role.position,
            })),
          };
        });
    
        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:54-54 (registration)
    Call to registerServerTools which includes the get_server_info tool registration in the main MCP server setup.
    registerServerTools(server);
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. It states the action ('Get detailed information') but doesn't cover critical aspects like required permissions (e.g., view server permissions), rate limits, whether it's idempotent, or what the output includes (e.g., server name, owner, channels). For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 front-loads the core purpose without unnecessary words. It avoids redundancy (e.g., not repeating the tool name) and wastes no space, making it easy for an agent to parse quickly.

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?

For a simple read tool with one well-documented parameter and no output schema, the description is minimally adequate but incomplete. It lacks details on behavioral aspects (permissions, output structure) and usage context, which are important given the absence of annotations. However, it suffices for basic invocation without being misleading.

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?

The input schema has 100% description coverage, with the 'guildId' parameter clearly documented as 'The ID of the server (guild)'. The description adds no additional parameter semantics beyond this, such as format examples (e.g., numeric string) or where to find the ID. Given the high schema coverage, a baseline score of 3 is appropriate as the schema does the heavy lifting.

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 ('Get') and resource ('detailed information about a specific Discord server'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_servers' or 'get_channel_info', which would require mentioning it retrieves comprehensive server metadata rather than just a list or channel-specific data.

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. It doesn't mention prerequisites (e.g., needing a valid guild ID), contrast it with 'list_servers' for browsing versus detailed lookup, or specify use cases like server configuration checks. Without such context, the agent must infer usage from the name alone.

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