Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_delete_channel

Remove Discord channels via MCP-Discord by specifying the channel ID and an optional reason for deletion, streamlining channel management tasks.

Instructions

Deletes a Discord channel with an optional reason

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
reasonNo

Implementation Reference

  • Handler function that executes the discord_delete_channel tool: fetches the channel, checks permissions, deletes it with optional reason, and returns success/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 defining the input parameters for the discord_delete_channel tool: required channelId and optional reason.
    const DeleteChannelSchema = z.object({ channelId: z.string(), reason: z.string().optional() });
  • src/index.ts:291-301 (registration)
    Tool registration in the MCP server's tool list, specifying name, description, and input schema.
    { 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"] }

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