Skip to main content
Glama

discord_get_forum_post

Retrieve details and messages from a specific Discord forum post using its thread ID.

Instructions

Retrieves details about a forum post including its messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
threadIdYes

Implementation Reference

  • The main handler function for discord_get_forum_post. Validates input via GetForumPostSchema, checks client readiness, fetches the thread by threadId, retrieves up to 10 messages, and returns thread details (id, name, parentId, messageCount, createdAt, messages).
    export const getForumPostHandler: ToolHandler = async (args, { client }) => {
      const { threadId } = GetForumPostSchema.parse(args);
    
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const thread = await client.channels.fetch(threadId);
        if (!thread?.isThread()) {
          return {
            content: [
              { type: 'text', text: `Cannot find thread with ID: ${threadId}` },
            ],
            isError: true,
          };
        }
    
        // Get messages from the thread
        const messages = await thread.messages.fetch({ limit: 10 });
    
        const threadDetails = {
          id: thread.id,
          name: thread.name,
          parentId: thread.parentId,
          messageCount: messages.size,
          createdAt: thread.createdAt,
          messages: messages.map((msg) => ({
            id: msg.id,
            content: msg.content,
            author: msg.author.tag,
            createdAt: msg.createdAt,
          })),
        };
    
        return {
          content: [{ type: 'text', text: JSON.stringify(threadDetails, null, 2) }],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    };
  • Zod schema for input validation of discord_get_forum_post. Expects a single required field: threadId (string).
    export const GetForumPostSchema = z.object({
      threadId: z.string(),
    });
  • Registration of the tool in the tool list. Defines tool name, description, and JSON Schema input schema with required threadId parameter.
      name: 'discord_get_forum_post',
      description: 'Retrieves details about a forum post including its messages',
      inputSchema: {
        type: 'object',
        properties: {
          threadId: { type: 'string' },
        },
        required: ['threadId'],
      },
    },
  • Re-export of getForumPostHandler from forum.ts, used as a barrel export for all tool handlers.
    export {
      createForumPostHandler,
      deleteForumPostHandler,
      getForumChannelsHandler,
      getForumPostHandler,
      replyToForumHandler,
    } from './forum.js';
  • src/server.ts:123-126 (registration)
    Routing case in server.ts that dispatches the 'discord_get_forum_post' tool request to getForumPostHandler.
    case 'discord_get_forum_post':
      this.logClientState('before discord_get_forum_post handler');
      toolResponse = await getForumPostHandler(args, this.toolContext);
      return toolResponse;
Behavior2/5

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

No annotations are provided, and the description only states it retrieves details and messages. It does not disclose authentication needs, rate limits, or whether it returns only recent messages.

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, concise sentence with no unnecessary words, effectively conveying the core function.

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 no output schema, the description should elaborate on what 'details' are returned. It covers the basic purpose but lacks specificity on data structure.

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

Parameters2/5

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

With 0% schema description coverage, the description does not explain the 'threadId' parameter or how to obtain it, leaving the agent to infer from the name alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieves' and the resource 'details about a forum post including its messages,' which is specific and distinguishes it from siblings like discord_get_forum_channels or discord_read_messages.

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 on when to use this tool versus alternatives, such as discord_read_messages or discord_get_forum_channels. The description lacks context for selection.

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