Skip to main content
Glama
hanweg

mcp-discord

by hanweg

list_members

Retrieve a list of members from a specified Discord server, with optional limits to customize the number of results returned.

Instructions

Get a list of members in a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of members to fetch
server_idYesDiscord server (guild) ID

Implementation Reference

  • The handler function for the 'list_members' tool. Fetches members from the specified Discord guild up to a given limit, collects their ID, name, nick, join date, and roles, then returns a formatted text list.
    elif name == "list_members":
        guild = await discord_client.fetch_guild(int(arguments["server_id"]))
        limit = min(int(arguments.get("limit", 100)), 1000)
        
        members = []
        async for member in guild.fetch_members(limit=limit):
            members.append({
                "id": str(member.id),
                "name": member.name,
                "nick": member.nick,
                "joined_at": member.joined_at.isoformat() if member.joined_at else None,
                "roles": [str(role.id) for role in member.roles[1:]]  # Skip @everyone
            })
        
        return [TextContent(
            type="text",
            text=f"Server Members ({len(members)}):\n" + 
                 "\n".join(f"{m['name']} (ID: {m['id']}, Roles: {', '.join(m['roles'])})" for m in members)
        )]
  • Registration of the 'list_members' tool in the @app.list_tools() handler, defining the tool name, description, and input schema requiring server_id (optional limit).
    Tool(
        name="list_members",
        description="Get a list of members in a server",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {
                    "type": "string",
                    "description": "Discord server (guild) ID"
                },
                "limit": {
                    "type": "number",
                    "description": "Maximum number of members to fetch",
                    "minimum": 1,
                    "maximum": 1000
                }
            },
            "required": ["server_id"]
        }
    ),
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool fetches a list but doesn't describe what the list contains (e.g., member IDs, names, roles), whether it's paginated, rate limits, authentication requirements, or error conditions. This leaves significant gaps for a tool that likely interacts with external APIs.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple list operation and front-loaded with the core functionality.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the returned list contains, how members are ordered, whether all members are fetched or just a subset, or any behavioral traits like rate limits. For a tool with external API interactions and no structured output documentation, this is inadequate.

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 100%, with clear documentation for both parameters ('server_id' and 'limit'), so the baseline is 3. The description adds no additional parameter semantics beyond what the schema provides, such as explaining Discord server ID format or typical limit values.

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 action ('Get a list') and resource ('members in a server'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential siblings like 'get_user_info' or 'get_server_info' that might also retrieve member-related data, preventing 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. With siblings like 'get_user_info' (which might retrieve individual member details) and 'get_server_info' (which might include member counts), there's no indication of when this list-focused tool is preferred or what prerequisites exist (e.g., needing server access).

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

Related 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/hanweg/mcp-discord'

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