discord_reply_to_forum
Add a reply to an existing Discord forum thread by providing the thread ID and message content.
Instructions
Adds a reply to an existing forum post or thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threadId | Yes | ||
| message | Yes |
Implementation Reference
- src/index.ts:738-778 (handler)The main execution logic for the 'discord_reply_to_forum' tool. Fetches the specified thread by ID, validates it supports sending messages, and sends the provided message as a reply.case "discord_reply_to_forum": { const { threadId, message } = ReplyToForumSchema.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 }; } if (!('send' in thread)) { return { content: [{ type: "text", text: `This thread does not support sending messages` }], isError: true }; } // Send the reply const sentMessage = await thread.send(message); return { content: [{ type: "text", text: `Successfully replied to forum post. Message ID: ${sentMessage.id}` }] }; } catch (error) { return { content: [{ type: "text", text: `Failed to reply to forum post: ${error}` }], isError: true }; } }
- src/index.ts:163-166 (schema)Zod input validation schema for the tool, defining required string parameters 'threadId' and 'message'.const ReplyToForumSchema = z.object({ threadId: z.string(), message: z.string() });
- src/index.ts:266-277 (registration)Tool registration in the MCP server's tool list, providing name, description, and JSON schema for inputs.{ name: "discord_reply_to_forum", description: "Adds a reply to an existing forum post or thread", inputSchema: { type: "object", properties: { threadId: { type: "string" }, message: { type: "string" } }, required: ["threadId", "message"] } },