discord_get_forum_post
Retrieve detailed information about a Discord forum post, including its messages, by specifying the thread ID using this tool on the MCP-Discord server.
Instructions
Retrieves details about a forum post including its messages
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threadId | Yes |
Implementation Reference
- src/index.ts:692-736 (handler)Handler function for discord_get_forum_post tool that fetches a Discord forum post/thread by ID, retrieves its details and recent messages, and returns them as JSON.case "discord_get_forum_post": { const { threadId } = GetForumPostSchema.parse(args); try { if (!client.isReady()) { return { content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }], isError: true }; } const thread = await client.channels.fetch(threadId); if (!thread || !(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 { content: [{ type: "text", text: `Failed to fetch forum post: ${error}` }], isError: true }; } }
- src/index.ts:159-161 (schema)Zod schema for input validation of discord_get_forum_post tool, requiring a threadId string.const GetForumPostSchema = z.object({ threadId: z.string() });
- src/index.ts:255-265 (registration)Tool registration in the listTools response, defining name, description, and input schema for discord_get_forum_post.{ name: "discord_get_forum_post", description: "Retrieves details about a forum post including its messages", inputSchema: { type: "object", properties: { threadId: { type: "string" } }, required: ["threadId"] } },