Skip to main content
Glama

discord_get_role_members

Retrieve all Discord server members assigned to a specific role by providing guild and role IDs.

Instructions

List all members that have a specific role.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes
role_idYes

Implementation Reference

  • The handler implementation for the `discord_get_role_members` tool which fetches guild members and lists them by role ID.
    case "discord_get_role_members": {
      const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
      await guild.members.list({ limit: 1000 });
      const role = await guild.roles.fetch(args.role_id as string) as Role;
      const members = role.members.map((m) => ({ id: m.id, username: m.user.tag, nickname: m.nickname }));
      return { content: [{ type: "text", text: JSON.stringify(members, null, 2) }] };
    }
  • The schema definition for the `discord_get_role_members` tool, specifying the required `guild_id` and `role_id` parameters.
    {
      name: "discord_get_role_members",
      description: "List all members that have a specific role.",
      inputSchema: {
        type: "object",
        properties: {
          guild_id: { type: "string" },
          role_id: { type: "string" },
        },
        required: ["guild_id", "role_id"],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists members, implying a read-only operation, but doesn't clarify critical aspects like whether it requires specific permissions, returns paginated results, includes member details beyond IDs, or handles errors (e.g., invalid role IDs). For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action ('List all members') and specifies the condition ('that have a specific role'), making it immediately understandable. Every part of the sentence contributes directly to explaining the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a Discord API tool with two parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral traits (e.g., permissions, rate limits), parameter details, or return values (e.g., what data is included in the member list). For a tool in this context, more information is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the input schema provides no descriptions for the two parameters (guild_id and role_id). The description doesn't compensate by explaining what these parameters represent (e.g., Discord server ID and role identifier), their expected formats (e.g., numeric strings), or where to obtain them. This leaves the parameters semantically unclear beyond their names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List all members that have a specific role.' It uses a specific verb ('List') and identifies the resource ('members with a specific role'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'discord_list_members' or 'discord_get_member_info', which could cause confusion about when to use this specific role-based listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing guild and role IDs), compare it to similar tools like 'discord_list_members' (which might list all members without role filtering), or specify use cases (e.g., auditing role assignments). This lack of context leaves the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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