Skip to main content
Glama

discord_add_role

Assign a role to a Discord member by providing guild, user, and role IDs. This tool manages user permissions and access within Discord servers.

Instructions

Assign a role to a member.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes
user_idYes
role_idYes
reasonNo

Implementation Reference

  • The handler logic for 'discord_add_role', which fetches the guild and member, then adds the specified role.
    case "discord_add_role": {
      const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
      const member = await guild.members.fetch(args.user_id as string);
      await member.roles.add(args.role_id as string, args.reason as string | undefined);
      return { content: [{ type: "text", text: `✅ Role added to ${member.user.tag}.` }] };
    }
  • The tool definition and input schema for 'discord_add_role'.
    {
      name: "discord_add_role",
      description: "Assign a role to a member.",
      inputSchema: {
        type: "object",
        properties: {
          guild_id: { type: "string" },
          user_id: { type: "string" },
          role_id: { type: "string" },
          reason: { type: "string" },
        },
        required: ["guild_id", "user_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