Skip to main content
Glama
scarecr0w12

discord-mcp

get_channel_info

Retrieve detailed information about a specific Discord channel using server and channel IDs to manage and maintain Discord servers.

Instructions

Get detailed information about a specific channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
channelIdYesThe ID of the channel

Implementation Reference

  • The core handler function that fetches the Discord guild and channel, extracts base and type-specific information (text/voice), handles permissions and errors, and returns JSON-formatted data.
    async ({ guildId, channelId }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const channel = await guild.channels.fetch(channelId);
        if (!channel) throw new Error('Channel not found');
    
        // Cast to GuildChannel for common properties
        const guildChannel = channel as GuildChannel;
    
        const baseInfo: Record<string, unknown> = {
          id: channel.id,
          name: channel.name,
          type: channel.type,
          typeName: ChannelType[channel.type],
          parentId: guildChannel.parentId,
          createdAt: channel.createdAt?.toISOString(),
        };
    
        // Add position and permission overwrites for non-thread channels
        if ('position' in guildChannel) {
          baseInfo.position = guildChannel.position;
        }
        if ('permissionOverwrites' in guildChannel && guildChannel.permissionOverwrites) {
          baseInfo.permissionOverwrites = guildChannel.permissionOverwrites.cache.map((po) => ({
            id: po.id,
            type: po.type,
            allow: po.allow.toArray(),
            deny: po.deny.toArray(),
          }));
        }
    
        // Add text channel specific info
        if (channel.type === ChannelType.GuildText || channel.type === ChannelType.GuildAnnouncement) {
          const textChannel = channel as TextChannel;
          return {
            ...baseInfo,
            topic: textChannel.topic,
            nsfw: textChannel.nsfw,
            rateLimitPerUser: textChannel.rateLimitPerUser,
          };
        }
    
        // Add voice channel specific info
        if (channel.type === ChannelType.GuildVoice || channel.type === ChannelType.GuildStageVoice) {
          const voiceChannel = channel as VoiceChannel;
          return {
            ...baseInfo,
            bitrate: voiceChannel.bitrate,
            userLimit: voiceChannel.userLimit,
            rtcRegion: voiceChannel.rtcRegion,
          };
        }
    
        return baseInfo;
      });
    
      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 required guildId and channelId parameters.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      channelId: z.string().describe('The ID of the channel'),
    },
  • Registration of the 'get_channel_info' tool on the MCP server within registerChannelTools function.
    server.tool(
      'get_channel_info',
      'Get detailed information about a specific channel',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        channelId: z.string().describe('The ID of the channel'),
      },
      async ({ guildId, channelId }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const channel = await guild.channels.fetch(channelId);
          if (!channel) throw new Error('Channel not found');
    
          // Cast to GuildChannel for common properties
          const guildChannel = channel as GuildChannel;
    
          const baseInfo: Record<string, unknown> = {
            id: channel.id,
            name: channel.name,
            type: channel.type,
            typeName: ChannelType[channel.type],
            parentId: guildChannel.parentId,
            createdAt: channel.createdAt?.toISOString(),
          };
    
          // Add position and permission overwrites for non-thread channels
          if ('position' in guildChannel) {
            baseInfo.position = guildChannel.position;
          }
          if ('permissionOverwrites' in guildChannel && guildChannel.permissionOverwrites) {
            baseInfo.permissionOverwrites = guildChannel.permissionOverwrites.cache.map((po) => ({
              id: po.id,
              type: po.type,
              allow: po.allow.toArray(),
              deny: po.deny.toArray(),
            }));
          }
    
          // Add text channel specific info
          if (channel.type === ChannelType.GuildText || channel.type === ChannelType.GuildAnnouncement) {
            const textChannel = channel as TextChannel;
            return {
              ...baseInfo,
              topic: textChannel.topic,
              nsfw: textChannel.nsfw,
              rateLimitPerUser: textChannel.rateLimitPerUser,
            };
          }
    
          // Add voice channel specific info
          if (channel.type === ChannelType.GuildVoice || channel.type === ChannelType.GuildStageVoice) {
            const voiceChannel = channel as VoiceChannel;
            return {
              ...baseInfo,
              bitrate: voiceChannel.bitrate,
              userLimit: voiceChannel.userLimit,
              rtcRegion: voiceChannel.rtcRegion,
            };
          }
    
          return baseInfo;
        });
    
        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:55-55 (registration)
    Invocation of registerChannelTools in the main MCP server setup.
    registerChannelTools(server);
  • src/index.ts:12-12 (registration)
    Import of the registerChannelTools function.
    import { registerChannelTools } from './tools/channel-tools.js';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states what the tool does ('Get detailed information') without describing what information is returned, whether it requires specific permissions, rate limits, or any side effects. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with no wasted words. It could be slightly improved by front-loading more context, but it's appropriately sized for a simple retrieval tool.

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?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, the format of the response, or any behavioral considerations. Given the lack of structured data, the description should provide more context about what the tool actually returns.

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 both parameters clearly documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline of 3 where 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 channel', making the purpose unambiguous. However, it doesn't differentiate from potential sibling tools like 'get_server_info' or 'get_member_info' beyond specifying the channel focus.

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 when to use 'get_channel_info' versus 'list_channels' (which appears in siblings) or other information-retrieval tools, nor does it specify any prerequisites or context for usage.

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