Assign role
assign_roleAssigns a role to a Discord member after checking the bot's role hierarchy to prevent 403 errors, and requires confirmation for roles granting moderation, admin, or hidden-channel access.
Instructions
Give a member a role. Preflights the bot's role hierarchy so the failure mode is an explanation, not a 403. Supports dry_run. A role that would give the member moderator or admin powers (such as banning, kicking, or timing out members, deleting other people's messages, or managing the server, roles, or channels), or let them see channels hidden from them now, needs confirming: the first call changes nothing and returns a preview and a confirm_token, and repeating the call with the token makes the change. Other roles are given at once.
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": {
"member": "<member>",
"role": "<role>"
},
"name": "assign_role"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | Yes | Role name or ID. | |
| guild | No | Guild (server) name or ID. Omit to use the default guild. | |
| member | Yes | Member name or user ID. | |
| reason | No | Audit log reason. | |
| dry_run | No | Preview without assigning. | |
| confirm_token | No | The token from this exact action's preview. Where the app can show a confirmation dialog, calling with it asks the user there, and it happens only if they agree. |