Skip to main content
Glama

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
NameRequiredDescriptionDefault
guild_idYes
role_idYes
nameNo
colorNo
hoistNo
mentionableNo
permissionsNo

Implementation Reference

  • 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.` }] };
    }
  • 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"],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PaSympa/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server