Skip to main content
Glama

discord_get_forum_channels

Retrieve all forum channels from a Discord server using the guild ID to manage discussions and organize community content.

Instructions

Lists all forum channels in a specified Discord server (guild)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYes

Implementation Reference

  • The core handler function that validates input with GetForumChannelsSchema, fetches the Discord guild, retrieves all channels, filters for forum channels (GuildForum type), formats their details (id, name, topic), and returns JSON stringified list or appropriate error messages.
    export const getForumChannelsHandler: ToolHandler = async (
      args,
      { client }
    ) => {
      const { guildId } = GetForumChannelsSchema.parse(args);
    
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const guild = await client.guilds.fetch(guildId);
        if (!guild) {
          return {
            content: [
              { type: 'text', text: `Cannot find guild with ID: ${guildId}` },
            ],
            isError: true,
          };
        }
    
        // Fetch all channels from the guild
        const channels = await guild.channels.fetch();
    
        // Filter to get only forum channels
        const forumChannels = channels.filter(
          (channel) => channel?.type === ChannelType.GuildForum
        );
    
        if (forumChannels.size === 0) {
          return {
            content: [
              {
                type: 'text',
                text: `No forum channels found in guild: ${guild.name}`,
              },
            ],
          };
        }
    
        // Format forum channels information
        const forumInfo = forumChannels.map((channel) => ({
          id: channel.id,
          name: channel.name,
          topic: channel.topic || 'No topic set',
        }));
    
        return {
          content: [{ type: 'text', text: JSON.stringify(forumInfo, null, 2) }],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    };
  • The tool's input schema definition used for MCP tool listing and validation, specifying guildId as required string parameter.
    {
      name: 'discord_get_forum_channels',
      description:
        'Lists all forum channels in a specified Discord server (guild)',
      inputSchema: {
        type: 'object',
        properties: {
          guildId: { type: 'string' },
        },
        required: ['guildId'],
      },
    },
  • src/server.ts:110-116 (registration)
    Registration and dispatch in the MCP Server's CallToolRequestSchema handler switch statement, logging client state before calling the tool handler.
    case 'discord_get_forum_channels':
      this.logClientState('before discord_get_forum_channels handler');
      toolResponse = await getForumChannelsHandler(
        args,
        this.toolContext
      );
      return toolResponse;
  • Tool dispatch in StreamableHttpTransport's handleMcpRequest method for direct method calls, calling the handler after login check.
    case 'discord_get_forum_channels':
      result = await getForumChannelsHandler(
        params,
        this.toolContext!
      );
      break;
  • Tool dispatch in StreamableHttpTransport for tools/call method format, calling the handler after login check.
    case 'discord_get_forum_channels':
      result = await getForumChannelsHandler(
        toolArgs,
        this.toolContext!
      );
      break;
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 states it 'Lists all forum channels', implying a read-only operation, but does not cover aspects like permissions required, rate limits, pagination, or error handling. This leaves significant gaps for a tool that interacts with an external API like Discord.

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 key action and resource without any wasted words. It is appropriately sized for a simple list operation, making it easy to parse quickly.

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 complexity of interacting with Discord's API, no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on return values (e.g., channel structure), error cases, or authentication needs, which are crucial for effective tool use in this context.

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 1 parameter with 0% description coverage, so the schema provides no semantic details. The description adds meaning by specifying 'in a specified Discord server (guild)', clarifying that guildId refers to a server identifier. However, it does not explain format (e.g., numeric ID vs. name) or constraints, so it partially compensates but not fully.

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 the resource 'all forum channels in a specified Discord server (guild)', making the purpose explicit. However, it does not differentiate from sibling tools like discord_get_server_info (which might include channels) or discord_get_forum_post (which retrieves individual posts), so it misses full sibling distinction.

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, such as discord_get_server_info for broader server details or discord_create_forum_post for creating content. It lacks explicit when/when-not instructions or named alternatives, offering only basic context without exclusions.

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

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