Skip to main content
Glama
scarecr0w12

discord-mcp

delete_channel_permission

Remove permission overwrites for roles or members on Discord channels to manage access control and resolve conflicts.

Instructions

Delete a permission overwrite for a role or member on a channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
channelIdYesThe ID of the channel
targetIdYesThe ID of the role or member
reasonNoReason for the deletion

Implementation Reference

  • Handler function that fetches the guild and channel, deletes the permission overwrite for the targetId, and returns success/error response.
    async ({ guildId, channelId, targetId, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const channel = await guild.channels.fetch(channelId);
        if (!channel) throw new Error('Channel not found');
    
        const guildChannel = channel as GuildChannel;
        await guildChannel.permissionOverwrites.delete(targetId, reason);
    
        return {
          channelId,
          channelName: channel.name,
          targetId,
          message: 'Permission overwrite deleted successfully',
        };
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Input schema using Zod for validating guildId, channelId, targetId, and optional reason.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      channelId: z.string().describe('The ID of the channel'),
      targetId: z.string().describe('The ID of the role or member'),
      reason: z.string().optional().describe('Reason for the deletion'),
    },
  • Registers the 'delete_channel_permission' tool on the MCP server with name, description, input schema, and handler function.
    server.tool(
      'delete_channel_permission',
      'Delete a permission overwrite for a role or member on a channel',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        channelId: z.string().describe('The ID of the channel'),
        targetId: z.string().describe('The ID of the role or member'),
        reason: z.string().optional().describe('Reason for the deletion'),
      },
      async ({ guildId, channelId, targetId, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const channel = await guild.channels.fetch(channelId);
          if (!channel) throw new Error('Channel not found');
    
          const guildChannel = channel as GuildChannel;
          await guildChannel.permissionOverwrites.delete(targetId, reason);
    
          return {
            channelId,
            channelName: channel.name,
            targetId,
            message: 'Permission overwrite deleted successfully',
          };
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • src/index.ts:58-58 (registration)
    Calls registerPermissionTools(server) within createMcpServer to register all permission tools including delete_channel_permission.
    registerPermissionTools(server);
  • src/index.ts:15-15 (registration)
    Imports the registerPermissionTools function from permission-tools.ts.
    import { registerPermissionTools } from './tools/permission-tools.js';
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 tool performs a deletion, implying a destructive mutation, but doesn't clarify if this is reversible, what permissions are required, whether it affects other settings, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves critical behavioral aspects undocumented.

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 that front-loads the core action and target. Every word earns its place with no redundancy or fluff, making it easy to parse quickly while remaining technically precise.

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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks behavioral details (e.g., permissions needed, side effects), usage context, and any information about return values or error conditions. While the schema covers parameters well, the overall context for safe and correct invocation is insufficient.

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 input schema has 100% description coverage, clearly documenting all four parameters (guildId, channelId, targetId, reason). The description adds no additional semantic context beyond what the schema provides, such as explaining what a 'permission overwrite' entails or how targetId distinguishes between roles and members. Baseline 3 is appropriate when the schema does the heavy lifting.

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 specific action ('Delete a permission overwrite') and the target ('for a role or member on a channel'), distinguishing it from siblings like 'delete_channel' (which deletes the entire channel) or 'remove_role' (which removes a role from a member). It uses precise terminology that aligns with Discord's permission system.

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 appropriate permissions), contrast with 'set_channel_permission' (which modifies rather than deletes), or indicate scenarios where deletion is appropriate versus other permission management tools.

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

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