Skip to main content
Glama

discord_list_roles

Retrieve all roles in a Discord guild with their permissions and member counts to manage server structure and access controls.

Instructions

List all roles in a guild with permissions and member count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes

Implementation Reference

  • The handler implementation for the discord_list_roles tool, which fetches the guild, retrieves roles, processes them, and returns them as a JSON string.
    case "discord_list_roles": {
      const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
      const roles = await guild.roles.fetch();
      const result = [...roles.values()]
        .filter((r) => r.name !== "@everyone")
        .sort((a, b) => b.position - a.position)
        .map((r) => ({
          id: r.id, name: r.name, color: r.hexColor, position: r.position,
          memberCount: r.members.size, permissions: serializePermissions(r.permissions),
          hoist: r.hoist, mentionable: r.mentionable,
        }));
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • The definition and input schema for the discord_list_roles tool.
    {
      name: "discord_list_roles",
      description: "List all roles in a guild with permissions and member count.",
      inputSchema: {
        type: "object",
        properties: { guild_id: { type: "string" } },
        required: ["guild_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. It mentions the output includes 'permissions and member count,' which adds some behavioral context beyond the basic listing action. However, it doesn't disclose critical traits like whether this is a read-only operation, rate limits, authentication requirements, pagination behavior, or error conditions. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 that front-loads the core action ('List all roles in a guild') and adds useful detail ('with permissions and member count') without waste. It's appropriately sized for the tool's simplicity, with no redundant or verbose language.

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 tool's moderate complexity (listing roles with details), no annotations, no output schema, and low schema coverage, the description is incomplete. It covers the basic purpose but lacks behavioral transparency, usage guidelines, and detailed parameter semantics. For a tool that likely returns structured data (roles with permissions and counts), more context on output format or limitations would be helpful, especially without annotations or output schema.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It implies the 'guild_id' parameter is used to specify the guild, but doesn't add meaning beyond what the schema's property name suggests (e.g., format, examples, or constraints). With one parameter and low coverage, the description provides minimal semantic value, aligning with the baseline for adequate but incomplete parameter information.

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 verb ('List') and resource ('all roles in a guild'), specifying what information is included ('with permissions and member count'). It distinguishes from siblings like 'discord_get_role_members' (which focuses on members of a specific role) and 'discord_edit_role' (which modifies roles). However, it doesn't explicitly contrast with all similar tools, such as 'discord_get_guild_info' which might include role data, keeping it from a perfect score.

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 access), exclusions (e.g., not for filtering roles), or direct comparisons to siblings like 'discord_get_role_members' for detailed member lists. Usage is implied by the action 'List all roles,' but explicit context is lacking.

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