Skip to main content
Glama

discord_delete_forum_post

Delete a forum post or thread in Discord by providing its ID, with an optional reason for the deletion.

Instructions

Deletes a forum post or thread with an optional reason

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
threadIdYes
reasonNo

Implementation Reference

  • The deleteForumPostHandler function that executes the 'discord_delete_forum_post' tool logic. It takes threadId and reason, fetches the thread via Discord API, verifies it's a thread, and deletes it.
    export const deleteForumPostHandler: ToolHandler = async (args, { client }) => {
      const { threadId, reason } = DeleteForumPostSchema.parse(args);
    
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const thread = await client.channels.fetch(threadId);
        if (!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 handleDiscordError(error);
      }
    };
  • DeleteForumPostSchema - Zod schema validating threadId (string, required) and reason (string, optional). Used by the handler to parse and validate input arguments.
    export const DeleteForumPostSchema = z.object({
      threadId: z.string(),
      reason: z.string().optional(),
    });
  • Tool registration entry in toolList array defining name 'discord_delete_forum_post', description, and inputSchema with threadId (required) and reason (optional).
    {
      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'],
      },
    },
  • src/server.ts:133-136 (registration)
    Case handler in server.ts routing the 'discord_delete_forum_post' tool call to deleteForumPostHandler.
    case 'discord_delete_forum_post':
      this.logClientState('before discord_delete_forum_post handler');
      toolResponse = await deleteForumPostHandler(args, this.toolContext);
      return toolResponse;
  • ToolHandler type definition that the handler conforms to.
    export type ToolHandler<T = any> = (
      args: T,
      context: ToolContext
    ) => Promise<ToolResponse>;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only states the destructive action and the optional reason field, but omits important details such as permission requirements, reversibility, error states, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the action. It could be slightly improved by separating the reason detail, but overall it is concise and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a delete tool with no output schema and no annotations, the description lacks critical context: return value (success/error), permissions needed, behavior on non-existent targets, and whether the reason is mandatory for auditing. It feels incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description adds no meaning to parameters. 'threadId' is ambiguous (forum post ID or thread ID?), and 'reason' is unexplained (audit log? display?). The schema only provides types, not semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Deletes'), the resource ('forum post or thread'), and adds a detail ('with an optional reason'). It distinguishes from sibling tools like discord_delete_channel or discord_delete_message by specifying the target type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., discord_delete_channel for channels, or discord_delete_message for messages). The description does not mention any context or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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