Create role
discord_
Write
- Toolset
- Roles
roles - Discord permission
- Manage Roles
- Context cost
- 320 tokens, estimated1,281 bytes of definition, divided by 4
Create a new role in a server. Requires the Manage Roles permission; the new role is placed below the bot's highest role. Use discord_ to then assign it to members. Returns the new role's name and ID. To change an existing role, use discord_.
Risk and annotations
Read-onlyreadOnlyHint | no | Can modify your server. |
|---|---|---|
DestructivedestructiveHint | no | Declared non-destructive. |
IdempotentidempotentHint | no | Repeating the call can have an 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). |
| namerequired | string | none | Name of the new role (max 100 characters). |
| coloroptional | string | pattern ^#[0-9A-Fa-f]{6}$ | Role color as a hex string, e.g. '#FF5733'. |
| hoistoptional | boolean | none | If true, display members with this role separately in the member list. |
| mentionableoptional | boolean | none | If true, anyone can @mention this role. |
| permissionsoptional | array of strings or string | none | Server-wide permission flag names to grant, e.g. ['SendMessages','ViewChannel']. Uses Discord PermissionsBitField flag names. |
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
Raw definition (1,281 bytes)
{
"name": "discord_create_role",
"description": "Create a new role in a server. Requires the Manage Roles permission; the new role is placed below the bot's highest role. Use discord_add_role to then assign it to members. Returns the new role's name and ID. To change an existing role, use discord_edit_role.",
"inputSchema": {
"type": "object",
"properties": {
"guild_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "Discord server (guild) ID (snowflake)."
},
"name": {
"type": "string",
"description": "Name of the new role (max 100 characters)."
},
"color": {
"description": "Role color as a hex string, e.g. '#FF5733'.",
"type": "string",
"pattern": "^#[0-9A-Fa-f]{6}$"
},
"hoist": {
"description": "If true, display members with this role separately in the member list.",
"type": "boolean"
},
"mentionable": {
"description": "If true, anyone can @mention this role.",
"type": "boolean"
},
"permissions": {
"description": "Server-wide permission flag names to grant, e.g. ['SendMessages','ViewChannel']. Uses Discord PermissionsBitField flag names.",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"required": [
"guild_id",
"name"
],
"additionalProperties": false
},
"annotations": {
"title": "Create role",
"readOnlyHint": false,
"destructiveHint": false,
"idempotentHint": false,
"openWorldHint": true
}
}