Skip to main content
Glama

discord_delete_channel

Remove a Discord channel using its channel ID and optionally specify a reason. This tool is part of the MCP-Discord server, which facilitates AI-driven Discord management tasks.

Instructions

Deletes a Discord channel with an optional reason

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
reasonNo

Implementation Reference

  • The main handler function that parses arguments using DeleteChannelSchema, fetches the Discord channel, validates it supports deletion, and deletes it using channel.delete(). Handles errors and client readiness.
    export async function deleteChannelHandler(
      args: unknown, 
      context: ToolContext
    ): Promise<ToolResponse> {
      const { channelId, reason } = DeleteChannelSchema.parse(args);
      try {
        if (!context.client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in." }],
            isError: true
          };
        }
    
        const channel = await context.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 handleDiscordError(error);
      }
    }
  • Zod schema used for input validation in the deleteChannelHandler, defining channelId as required string and reason as optional string.
    export const DeleteChannelSchema = z.object({
        channelId: z.string(),
        reason: z.string().optional()
    });
  • MCP tool definition including name, description, and JSON inputSchema advertised via ListTools.
    {
      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"]
      }
    },
  • src/server.ts:128-131 (registration)
    Switch case in CallToolRequest handler that dispatches to deleteChannelHandler for the "discord_delete_channel" tool.
    case "discord_delete_channel":
      this.logClientState("before discord_delete_channel handler");
      toolResponse = await deleteChannelHandler(args, this.toolContext);
      return toolResponse;
Behavior2/5

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

With no annotations provided, the description carries full burden but only mentions an 'optional reason' parameter. It fails to disclose critical behavioral traits: this is a destructive operation (permanent deletion), likely requires specific permissions (e.g., admin rights), may have rate limits, and doesn't describe what happens upon success/failure (e.g., confirmation message or error).

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, efficient sentence with zero wasted words. It's front-loaded with the core action and includes a useful detail about the optional parameter, making it appropriately concise for the tool's complexity.

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 tool's destructive nature, no annotations, no output schema, and low parameter coverage, the description is incomplete. It lacks essential context: permissions required, irreversible consequences, error handling, and comparison to sibling deletion tools, making it inadequate for safe and effective use.

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

Parameters3/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 but only adds minimal context: it notes 'reason' is optional. It doesn't explain 'channelId' format (e.g., numeric ID) or provide examples, leaving parameters largely undocumented. This meets the baseline for inadequate compensation.

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 clearly states the action ('Deletes') and resource ('a Discord channel'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'discord_delete_category' or 'discord_delete_message', which perform similar deletion operations on different resources, so it doesn't reach the highest 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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing admin permissions), exclusions (e.g., cannot delete default channels), or compare it to siblings like 'discord_delete_category' for context-specific choices.

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

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

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