Skip to main content
Glama

discord_set_role_permission

Configure Discord channel permissions for roles by allowing or denying specific actions like sending messages or viewing channels.

Instructions

Allow or deny specific permissions for a role on a channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
role_idYes
allowNoe.g. ['SendMessages','ViewChannel']
denyNo
reasonNo

Implementation Reference

  • The handler logic for "discord_set_role_permission", which updates role permission overwrites on a channel using discord.js.
    case "discord_set_role_permission": {
      const channel = await getGuildChannel(args.channel_id as string);
      const options: PermissionOverwriteOptions = {};
      parsePermArray(args.allow).forEach((p) => { (options as Record<string, boolean>)[p] = true; });
      parsePermArray(args.deny).forEach((p) => { (options as Record<string, boolean>)[p] = false; });
      await channel.permissionOverwrites.edit(args.role_id as string, options, { reason: args.reason as string | undefined });
      return { content: [{ type: "text", text: `✅ Permissions updated for role ${args.role_id} on #${channel.name}.` }] };
    }
  • The schema definition for "discord_set_role_permission", specifying the required inputs (channel_id, role_id) and optional inputs (allow, deny, reason).
    {
      name: "discord_set_role_permission",
      description: "Allow or deny specific permissions for a role on a channel.",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: { type: "string" },
          role_id: { type: "string" },
          allow: { type: "array", items: { type: "string" }, description: "e.g. ['SendMessages','ViewChannel']" },
          deny: { type: "array", items: { type: "string" } },
          reason: { type: "string" },
        },
        required: ["channel_id", "role_id"],
      },
    },

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

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