Add role to member
discord_
Write
- Toolset
- Roles
roles - Discord permission
- Manage Roles
- Context cost
- 241 tokens, estimated963 bytes of definition, divided by 4
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_ to undo.
Risk and annotations
Read-onlyreadOnlyHint | no | Can modify your server. |
|---|---|---|
DestructivedestructiveHint | no | Declared non-destructive. |
IdempotentidempotentHint | yes | Repeating the call with the same arguments has no additional effect. |
Open worldopenWorldHint | yes | Interacts with an external system: Discord. |
Annotations are hints the server declares. Clients use them to decide when to ask you before a call.
Parameters
| Parameter | Type | Rules | Description |
|---|---|---|---|
| guild_ | string | pattern ^\d{17,20}$ | Discord server (guild) ID (snowflake). |
| user_ | string | pattern ^\d{17,20}$ | Discord user ID (snowflake) of the member to give the role to. |
| role_ | string | pattern ^\d{17,20}$ | ID (snowflake) of the role to assign. |
| reasonoptional | string | none | Optional reason recorded in the server audit log. |
Output
This tool declares no output schema. Its description says what it returns; this page shows no example rather than invent one.
Related tools
Named in its description
Also in Roles
-
List roles, Read-only
discord_list_ roles -
Create role, Write
discord_create_ role -
Edit role, Write
discord_edit_ role -
Delete role, Destructive
discord_delete_ role -
Get role members, Read-only
discord_get_ role_ members -
Set role position, Write
discord_set_ role_ position -
Set role icon, Write
discord_set_ role_ icon
Raw definition (963 bytes)
{
"name": "discord_add_role",
"description": "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.",
"inputSchema": {
"type": "object",
"properties": {
"guild_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "Discord server (guild) ID (snowflake)."
},
"user_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "Discord user ID (snowflake) of the member to give the role to."
},
"role_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "ID (snowflake) of the role to assign."
},
"reason": {
"description": "Optional reason recorded in the server audit log.",
"type": "string"
}
},
"required": [
"guild_id",
"user_id",
"role_id"
],
"additionalProperties": false
},
"annotations": {
"title": "Add role to member",
"readOnlyHint": false,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true
}
}