Skip to main content
Glama

discord_set_role_permission

Idempotent

Add or update a role's per-channel permission overwrite, allowing or denying specific permissions while merging with existing settings. Controls what a role can do in a specific channel.

Instructions

Add or update a per-channel permission overwrite for a role, allowing and/or denying specific permissions. Merges with the role's existing overwrite (does not reset it). Denying View Channel to @everyone also locks the bot out unless it holds an allow overwrite of its own; grant that with discord_set_member_permission before the deny. Requires the Manage Roles permission. Use discord_set_member_permission to target a single member instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
denyNoPermission flag names to deny, e.g. ['SendMessages'] (or the same array JSON-encoded as a string).
allowNoPermission flag names to allow, e.g. ['SendMessages','ViewChannel'] (or the same array JSON-encoded as a string). Uses Discord PermissionsBitField flag names.
reasonNoOptional reason recorded in the server audit log.
role_idYesID (snowflake) of the role to grant/deny permissions for.
channel_idYesID (snowflake) of the channel to set the overwrite on.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.2.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed10 schema fields changedv2.0.0
    • addedInput schema / properties / allow / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / allow / description
      Previous value: -"Permission flag names to allow, e.g. ['SendMessages','ViewChannel']. Uses Discord PermissionsBitField flag names."New value: +"Permission flag names to allow, e.g. ['SendMessages','ViewChannel'] (or the same array JSON-encoded as a string). Uses Discord PermissionsBitField flag names."
    • removedInput schema / properties / allow / items
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / allow / type
      Removed value: -"array"
    • addedInput schema / properties / channel_id / pattern
      Added value: +"^\\d{17,20}$"
    • addedInput schema / properties / deny / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / deny / description
      Previous value: -"Permission flag names to deny, e.g. ['SendMessages']."New value: +"Permission flag names to deny, e.g. ['SendMessages'] (or the same array JSON-encoded as a string)."
    • removedInput schema / properties / deny / items
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / deny / type
      Removed value: -"array"
    • addedInput schema / properties / role_id / pattern
      Added value: +"^\\d{17,20}$"
  3. Changed5 schema fields changedv1.6.0
    • changedInput schema / properties / allow / description
      Previous value: -"e.g. ['SendMessages','ViewChannel']"New value: +"Permission flag names to allow, e.g. ['SendMessages','ViewChannel']. Uses Discord PermissionsBitField flag names."
    • addedInput schema / properties / channel_id / description
      Added value: +"ID (snowflake) of the channel to set the overwrite on."
    • addedInput schema / properties / deny / description
      Added value: +"Permission flag names to deny, e.g. ['SendMessages']."
    • addedInput schema / properties / reason / description
      Added value: +"Optional reason recorded in the server audit log."
    • addedInput schema / properties / role_id / description
      Added value: +"ID (snowflake) of the role to grant/deny permissions for."
  4. Addedv1.5.0
  5. Removedv1.0.0
  6. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description discloses that the operation merges with the existing overwrite rather than resetting it, requires the Manage Roles permission, and that denying View Channel to @everyone locks out the bot unless a separate allow overwrite is granted first. This meaningfully informs the agent of side effects and prerequisites, and does not contradict the idempotentHint or destructiveHint annotations.

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 four sentences long and every sentence earns its place: purpose, merge semantics, a critical bot-lockout warning with mitigation, the required permission, and the relevant sibling alternative. It is front-loaded with the core action and wastes no words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool without an output schema, the description is remarkably complete: it explains what the tool does, how it behaves on existing overwrites, the required permission, a dangerous edge case, and how to route to the member-targeting sibling. No critical operational guidance appears missing.

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 already provides 100% parameter coverage, including descriptions for allow, deny, reason, role_id, and channel_id. The description adds no new parameter-level detail beyond referencing 'allowing and/or denying specific permissions,' so the baseline of 3 is appropriate.

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 opens with a specific verb and resource: 'Add or update a per-channel permission overwrite for a role.' It clearly distinguishes this from member targeting by directing to discord_set_member_permission, and the 'Merges with the role's existing overwrite' note adds crucial scoping.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context including the required 'Manage Roles' permission and an explicit alternative: 'Use discord_set_member_permission to target a single member instead.' It also warns about a high-risk case (denying View Channel to @everyone) and how to avoid it, though it does not enumerate all related permission-management siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools