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>;

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It merely states the action and the optional reason, without mentioning permissions, irreversibility, side effects on replies, or error behavior. This adds little beyond the tool name.

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

Conciseness5/5

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

The description is a single, front-loaded sentence that directly states the action and the optional parameter. Every word is essential, with no redundant information or unnecessary elaboration.

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?

Given the destructive nature of deletion, the lack of annotations, and the absence of an output schema, the description should at least note irreversibility, required permissions, or what happens to related content. The current description is too sparse to fully inform an agent.

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

Parameters2/5

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

The schema has 0% description coverage, so the description must compensate. It mentions the 'optional reason' but does not explain its purpose or usage. The threadId parameter is not described beyond being required, which is already evident from the schema. Minimal added meaning.

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

Purpose4/5

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

The description uses the specific verb 'Deletes' and identifies the resource as 'forum post or thread', clearly distinguishing it from sibling deletion tools like discord_delete_category, discord_delete_channel, and discord_delete_message. However, it does not explicitly differentiate from alternatives, so it falls short of a perfect score.

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 is provided on when to use this tool versus alternatives such as discord_delete_message or discord_delete_channel. The description lacks any context about preferred scenarios, prerequisites, or exclusions.

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