discord_edit_role
Modify Discord server roles by updating name, color, permissions, visibility, and mention settings to manage member access and organization.
Instructions
Edit an existing role (name, color, permissions, hoist, mentionable).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guild_id | Yes | ||
| role_id | Yes | ||
| name | No | ||
| color | No | ||
| hoist | No | ||
| mentionable | No | ||
| permissions | No |
Implementation Reference
- src/tools/roles.ts:149-163 (handler)The handler case for 'discord_edit_role' that fetches the guild and role, then applies the updates using the discord.js edit method.
case "discord_edit_role": { const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id")); const role = await guild.roles.fetch(args.role_id as string) as Role; const perms = parsePerms(args.permissions); await role.edit({ name: args.name as string | undefined, color: args.color as ColorResolvable | undefined, hoist: args.hoist as boolean | undefined, mentionable: args.mentionable as boolean | undefined, permissions: perms ? new PermissionsBitField(perms.map((p) => PermissionsBitField.Flags[p as keyof typeof PermissionsBitField.Flags])) : undefined, }); return { content: [{ type: "text", text: `✅ Role "${role.name}" updated.` }] }; } - src/tools/roles.ts:33-48 (schema)The input schema definition for 'discord_edit_role'.
name: "discord_edit_role", description: "Edit an existing role (name, color, permissions, hoist, mentionable).", inputSchema: { type: "object", properties: { guild_id: { type: "string" }, role_id: { type: "string" }, name: { type: "string" }, color: { type: "string" }, hoist: { type: "boolean" }, mentionable: { type: "boolean" }, permissions: { type: "array", items: { type: "string" } }, }, required: ["guild_id", "role_id"], }, },