discord_delete_forum_post
Remove unwanted forum posts or threads from Discord with an optional reason for moderation.
Instructions
Deletes a forum post or thread with an optional reason
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threadId | Yes | ||
| reason | No |
Implementation Reference
- src/index.ts:1141-1174 (handler)Handler function that parses arguments using DeleteForumPostSchema, checks client readiness, fetches the thread by ID, verifies it's a thread, deletes it with optional reason, and returns success or error response.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 input parameters: 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 in the listTools response, specifying name, description, and inputSchema matching the handler's expected arguments.{ 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"] } },