Skip to main content
Glama
jar285

MCP-Discord

by jar285

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

Implementation Reference

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

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