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"]
      }
    },
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 ('Deletes') but doesn't mention critical behavioral aspects like required permissions, irreversibility of the action, rate limits, or what happens to channel content. This is inadequate for a destructive operation with zero annotation coverage.

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 directly states the tool's function and hints at a parameter. There's no wasted language, and the information is front-loaded, making it efficient for quick comprehension.

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 insufficient. It doesn't cover permissions, consequences, error handling, or return values, leaving the agent poorly equipped to use this tool safely and effectively.

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?

The description mentions an 'optional reason' parameter, which adds some semantic context beyond the schema's 0% coverage. However, it doesn't explain the 'channelId' parameter or provide details on format, constraints, or how to obtain it, leaving significant gaps in parameter understanding.

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. However, it doesn't differentiate this tool from sibling tools like 'discord_delete_message' or 'discord_delete_forum_post' beyond the resource type, which prevents 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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (e.g., permissions needed), consequences, or comparison to other deletion tools in the sibling list, leaving the agent with no contextual usage information.

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

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