Skip to main content
Glama
jar285

MCP-Discord

by jar285

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
NameRequiredDescriptionDefault
threadIdYes

Implementation Reference

  • 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 }; } }
  • 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"] } },

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

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