discord_delete_forum_post
Delete a Discord forum post or thread with an optional reason using this tool. Ideal for moderating and managing forum content efficiently on MCP Discord servers.
Instructions
Deletes a forum post or thread with an optional reason
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | ||
| threadId | Yes |
Implementation Reference
- src/index.ts:1141-1174 (handler)The main execution handler for the 'discord_delete_forum_post' tool. It validates input using DeleteForumPostSchema, checks client readiness, fetches the thread by ID, and deletes it if valid.case "discord_delete_forum_post": { const { threadId, reason } = DeleteForumPostSchema.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 forum post/thread with ID: ${threadId}` }], isError: true }; } // Delete the forum post/thread await thread.delete(reason || "Forum post deleted via API"); return { content: [{ type: "text", text: `Successfully deleted forum post/thread with ID: ${threadId}` }] }; } catch (error) { return { content: [{ type: "text", text: `Failed to delete forum post: ${error}` }], isError: true }; } }
- src/index.ts:110-113 (schema)Zod schema defining the input parameters for the discord_delete_forum_post tool: threadId (required string), reason (optional string). Used for validation in the handler.const DeleteForumPostSchema = z.object({ threadId: z.string(), reason: z.string().optional() });
- src/index.ts:374-385 (registration)Tool registration entry in the listTools response, providing name, description, and inputSchema matching the DeleteForumPostSchema.{ name: "discord_delete_forum_post", description: "Deletes a forum post or thread with an optional reason", inputSchema: { type: "object", properties: { threadId: { type: "string" }, reason: { type: "string" } }, required: ["threadId"] } },