Skip to main content
Glama

discord_delete_channel

Delete Discord channels from your server using this MCP-Discord tool. Specify the channel ID and optional reason to remove unwanted channels.

Instructions

Deletes a Discord channel with an optional reason

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
reasonNo

Implementation Reference

  • The core handler function that executes the Discord channel deletion logic using discord.js API, including validation, fetching, permission checks, and error handling.
    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);
      }
    }
  • MCP tool definition including name, description, and input schema for the tools/list endpoint.
    {
      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'],
      },
    },
  • Zod validation schema parsed in the handler for input arguments.
    export const DeleteChannelSchema = z.object({
      channelId: z.string(),
      reason: z.string().optional(),
    });
  • src/server.ts:146-149 (registration)
    Registration of the deleteChannelHandler in the MCP server's CallToolRequestSchema handler switch statement.
    case 'discord_delete_channel':
      this.logClientState('before discord_delete_channel handler');
      toolResponse = await deleteChannelHandler(args, this.toolContext);
      return toolResponse;
  • src/tools/tools.ts:2-6 (registration)
    Re-export of the handler from channel.ts for aggregation in tools.ts, imported by server.ts.
    createCategoryHandler,
    createTextChannelHandler,
    deleteCategoryHandler,
    deleteChannelHandler,
    editCategoryHandler,
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 mentions the action ('Deletes') and an optional reason, but fails to disclose critical traits like required permissions, irreversibility of deletion, effects on channel content, or rate limits. For a destructive operation with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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 extremely concise—a single sentence that front-loads the core action ('Deletes a Discord channel') and efficiently adds the optional reason detail. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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, lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't address permissions, consequences, error handling, or return values, which are essential for safe and effective use. The description alone is inadequate for a mutation tool with these contextual gaps.

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 for undocumented parameters. It mentions 'channelId' and 'reason' implicitly, but adds minimal semantic value—only noting that 'reason' is optional. It doesn't explain what channelId represents (e.g., format, how to obtain it) or provide examples, which is insufficient given the low schema coverage.

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 immediately understandable. It distinguishes from siblings like discord_delete_category and discord_delete_message by specifying the channel type, though it doesn't explicitly contrast with them. The description is specific but lacks explicit sibling differentiation for a full 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 like discord_delete_category or discord_delete_message, nor does it mention prerequisites such as required permissions or channel types. It states the action but offers no context for appropriate usage scenarios, leaving the agent to infer based on tool names alone.

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