Skip to main content
Glama

discord_get_server_stats

Retrieve Discord server statistics including member counts, channel details, roles, and boost level to monitor community growth and structure.

Instructions

Get server statistics: member count (humans vs bots), channels, roles, boost level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes

Implementation Reference

  • The logic for handling the discord_get_server_stats tool, which fetches guild data and compiles statistics.
    case "discord_get_server_stats": {
      const guild = await (await discord.guilds.fetch(validateId(args.guild_id, "guild_id"))).fetch();
      await guild.channels.fetch();
      const cachedBots = guild.members.cache.filter((m) => m.user.bot).size;
      return {
        content: [{
          type: "text", text: JSON.stringify({
            name: guild.name, totalMembers: guild.memberCount,
            humans: guild.memberCount - cachedBots, botsInCache: cachedBots,
            channels: {
              total: guild.channels.cache.size,
              text: guild.channels.cache.filter((c) => c.type === ChannelType.GuildText).size,
              voice: guild.channels.cache.filter((c) => c.type === ChannelType.GuildVoice).size,
              categories: guild.channels.cache.filter((c) => c.type === ChannelType.GuildCategory).size,
            },
            roles: guild.roles.cache.size - 1,
            boostLevel: guild.premiumTier, boostCount: guild.premiumSubscriptionCount ?? 0,
            createdAt: guild.createdAt.toISOString(),
          }, null, 2),
        }],
      };
    }
  • The MCP tool definition for discord_get_server_stats, including the input schema.
    {
      name: "discord_get_server_stats",
      description: "Get server statistics: member count (humans vs bots), channels, roles, boost level.",
      inputSchema: {
        type: "object",
        properties: { guild_id: { type: "string" } },
        required: ["guild_id"],
      },
    },

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