Skip to main content
Glama

discord_set_role_permission

Idempotent

Add or update per-channel permission overwrites for a role by allowing or denying specific permissions, merging with the role's existing overwrite instead of resetting it.

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 on a channel also hides it from the bot, unless the bot has Administrator or a View Channel allow overwrite there, on its own member or on one of its roles. Grant that allow first, for example with discord_set_member_permission, then deny. Requires the Manage Roles permission. Use discord_set_member_permission to target a single member instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "channel_id": "<channel_id>",
      "role_id": "<role_id>"
    },
    "name": "discord_set_role_permission"
  }
}

Input 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.9/5.0
Behavior5/5

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

Annotations cover safety flags (readOnly=false, destructive=false, idempotent=true), but the description adds substantial non-derivable behavior: allow/deny is a merge rather than a reset, and denying View Channel can lock the bot out of the channel unless an allow overwrite exists on the member or a role. That self-lockout hazard is exactly the kind of trap an agent cannot infer from 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?

Four dense sentences: purpose first, then the merge semantic, then the lockout hazard and its remedy, then the sibling pointer. Every sentence carries information an agent needs; nothing is repeated from the schema or annotations.

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 with no output schema, the definition covers purpose, merge semantics, permission prerequisites, the dangerous side effect, and the alternative tool. Nothing material for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description meaningfully clarifies how the allow and deny parameters interact with pre-existing overwrites (merge, not replace), which changes how an agent should compose the arrays. It does not add detail on reason or the snowflake formats, which the schema already documents.

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?

States a specific verb and resource: 'Add or update a per-channel permission overwrite for a role, allowing and/or denying specific permissions.' It also explicitly distinguishes itself from the sibling discord_set_member_permission ('Use discord_set_member_permission to target a single member instead'), so an agent can route without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit alternative and the condition that selects it (member vs role target), plus operational ordering guidance: grant the View Channel allow before denying, with a concrete example tool to use. It also states the prerequisite permission (Manage Roles).

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