Skip to main content
Glama

discord_add_role

Idempotent

Assign an existing role to a Discord member by providing guild, user, and role IDs. Requires the Manage Roles permission, and the role must be below the bot's highest role.

Instructions

Assign an existing role to a member. Requires the Manage Roles permission, and the role must be below the bot's highest role. Idempotent: assigning a role the member already has has no effect. Use discord_remove_role to undo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoOptional reason recorded in the server audit log.
role_idYesID (snowflake) of the role to assign.
user_idYesDiscord user ID (snowflake) of the member to give the role to.
guild_idYesDiscord server (guild) ID (snowflake).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.2.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed3 schema fields changedv2.0.0
    • addedInput schema / properties / guild_id / pattern
      Added value: +"^\\d{17,20}$"
    • addedInput schema / properties / role_id / pattern
      Added value: +"^\\d{17,20}$"
    • addedInput schema / properties / user_id / pattern
      Added value: +"^\\d{17,20}$"
  3. Changed4 schema fields changedv1.6.0
    • addedInput schema / properties / guild_id / description
      Added value: +"Discord server (guild) ID (snowflake)."
    • 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 assign."
    • addedInput schema / properties / user_id / description
      Added value: +"Discord user ID (snowflake) of the member to give the role to."
  4. Addedv1.5.0
  5. Removedv1.0.0
  6. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

The description adds meaningful behavioral context beyond the annotations: the Manage Roles permission requirement, the role hierarchy restriction, and the concrete effect of idempotency (assigning an already-held role has no effect). These details are not present in the raw annotations, which only flag idempotentHint.

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?

Three sentences, each earning its place: the action, the preconditions, and the idempotency/undo behavior. It is front-loaded with the core purpose and contains no filler.

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 straightforward role-assignment tool, the description fully covers the necessary execution context: required permission, hierarchy constraint, idempotent behavior, and the inverse sibling. No output schema exists, but the description covers the aspects that matter for invoking the tool correctly.

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?

The schema already covers all four parameters with 100% description coverage, which sets a baseline of 3. The description adds extra meaning beyond the schema by clarifying that the role must be an existing role and must sit below the bot's highest role, directly constraining the valid role_id values.

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 uses a specific verb and resource: 'Assign an existing role to a member.' It also distinguishes from the obvious sibling by naming discord_remove_role as the undo operation, so an agent can immediately tell this tool apart from related role and member tools.

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?

It states clear preconditions for use: requires the Manage Roles permission and the role must be below the bot's highest role. It also points to discord_remove_role as the inverse operation. It stops short of explicitly listing when not to use this tool versus other role-related tools, but the undo hint and role constraints provide solid guidance.

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