Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_delete_channel

Delete a Discord channel by providing its channel ID, with an optional reason for the deletion.

Instructions

Deletes a Discord channel with an optional reason

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
reasonNo

Implementation Reference

  • Handler function for discord_delete_channel tool. Parses arguments using DeleteChannelSchema, checks client readiness, fetches the channel, verifies deletability, deletes the channel using Discord.js API, and returns success or error response.
    case "discord_delete_channel": {
      const { channelId, reason } = DeleteChannelSchema.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 channel = await client.channels.fetch(channelId);
        if (!channel) {
          return {
            content: [{ type: "text", text: `Cannot find channel with ID: ${channelId}` }],
            isError: true
          };
        }
    
        // Check if channel can be deleted (has delete method)
        if (!('delete' in channel)) {
          return {
            content: [{ type: "text", text: `This channel type does not support deletion or the bot lacks permissions` }],
            isError: true
          };
        }
    
        // Delete the channel
        await channel.delete(reason || "Channel deleted via API");
    
        return {
          content: [{ 
            type: "text", 
            text: `Successfully deleted channel with ID: ${channelId}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to delete channel: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema for input validation of discord_delete_channel tool, defining channelId as required string and reason as optional string.
    const DeleteChannelSchema = z.object({
        channelId: z.string(),
        reason: z.string().optional()
    });
  • src/index.ts:291-302 (registration)
    Tool registration in the listTools response, including name, description, and inputSchema matching DeleteChannelSchema.
    {
      name: "discord_delete_channel",
      description: "Deletes a Discord channel with an optional reason",
      inputSchema: {
        type: "object",
        properties: {
          channelId: { type: "string" },
          reason: { type: "string" }
        },
        required: ["channelId"]
      }
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but omits consequences such as irreversibility, permission requirements, impact on messages or child objects, and rate limits. For a destructive operation, this is a significant transparency gap.

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 concise sentence that directly states the action and the optional parameter. It is efficient and easily parsed, with no wasted words.

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

Completeness3/5

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

Given the tool's simplicity (two parameters, no output schema), the description is minimally adequate but not complete. It lacks any discussion of side effects, permissions, or error scenarios, which are important for a destructive operation. It does not explain the return value or success indicators, but no output schema exists to compensate.

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?

Schema description coverage is 0%, so the description must compensate. It mentions 'an optional reason' and implies channelId, but does not explain what each parameter is for (e.g., reason for audit logs) or expected formats. This adds minimal meaning beyond the parameter names.

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') and the resource ('a Discord channel'), which precisely distinguishes it from sibling tools like discord_delete_message and discord_delete_webhook. It also mentions the optional reason, adding a small scope detail.

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. It does not mention prerequisites, exclusions, or scenarios where other delete tools should be preferred. The bare description leaves the agent to infer usage solely from the tool name.

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