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;

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the purpose and does not disclose any behavioral traits such as permissions, side effects, error handling, or return format specifics.

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, front-loaded sentence with no filler. Every word contributes to conveying the tool's 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?

The tool is simple (one param, no output schema), and the description gives a high-level return overview ('details... including its messages'). However, it lacks parameter mapping and any mention of response structure or error conditions, leaving notable gaps.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not mention the threadId parameter at all. It fails to add any meaning beyond the bare schema field name 'threadId'.

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?

Description uses specific verb 'retrieves' and resource 'forum post', and clarifies it includes messages. This clearly distinguishes it from sibling tools like discord_get_forum_channels (which lists channels) and discord_read_messages (which reads general 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 vs alternatives. It doesn't mention scenarios, exclusions, or alternatives, so the agent receives no contextual decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.