Skip to main content
Glama
wowjinxy
by wowjinxy

list_servers

View all Discord servers where the bot is currently active to manage connections and monitor bot presence.

Instructions

List the Discord servers the bot is currently connected to.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function that iterates over discord_client.guilds, collects server details (name, ID, member count, created_at, owner_id), formats a markdown list, and returns as TextContent. Handles empty case.
    @staticmethod
    async def handle_list_servers(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """List all servers the bot has access to"""
        servers_info = []
        
        for guild in discord_client.guilds:
            servers_info.append({
                "name": guild.name,
                "id": guild.id,
                "member_count": guild.member_count,
                "created_at": guild.created_at.strftime('%Y-%m-%d'),
                "owner_id": guild.owner_id
            })
        
        if not servers_info:
            return [TextContent(type="text", text="No servers found. Make sure the bot is invited to servers.")]
        
        # Format the server list
        server_list = "\n".join([
            f"**{server['name']}**\n"
            f"  - ID: {server['id']}\n"
            f"  - Members: {server['member_count']}\n"
            f"  - Created: {server['created_at']}\n"
            for server in servers_info
        ])
        
        return [TextContent(
            type="text", 
            text=f"**Available Servers ({len(servers_info)}):**\n\n{server_list}"
        )]
  • Registers the 'list_servers' tool in the @app.list_tools() function with description and empty inputSchema (no args needed).
        Tool(
            name="list_servers",
            description="Get a list of all Discord servers the bot has access to with detailed information",
            inputSchema={
                "type": "object",
                "properties": {},
                "required": []
            }
        )
    ]
  • In @app.call_tool() dispatcher, includes 'list_servers' in core_tool_names list and dynamically calls CoreToolHandlers.handle_list_servers if matched.
    core_tool_names = [
        "get_server_info", "list_servers", "get_channels", "list_members",
        "get_user_info", "send_message", "read_messages", "add_reaction",
        "add_multiple_reactions", "remove_reaction", "moderate_message",
        "create_text_channel", "delete_channel", "add_role", "remove_role"
    ]
    
    if name in core_tool_names:
        handler_method = f"handle_{name}"
        if hasattr(CoreToolHandlers, handler_method):
            return await getattr(CoreToolHandlers, handler_method)(discord_client, arguments)
  • Imports the CoreToolHandlers class containing the list_servers handler.
    from .core_tool_handlers import CoreToolHandlers
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe important traits: whether it requires specific permissions, how results are formatted (e.g., pagination, sorting), rate limits, or what 'currently connected to' means in practice (e.g., cached vs. real-time data).

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, clear sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

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

Completeness3/5

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

For a simple read operation with 0 parameters and an output schema (which handles return values), the description is minimally adequate. However, it lacks context about behavioral aspects (permissions, data freshness, format) that would be helpful given the absence of annotations and the tool's role among many Discord management siblings.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter explanation in the description. The description appropriately doesn't mention parameters, which is correct for a parameterless tool.

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 ('List') and the resource ('Discord servers the bot is currently connected to'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_server_info' which might retrieve detailed information about a specific server rather than listing all servers.

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 (like bot permissions), timing considerations, or compare it to similar tools in the sibling list (e.g., 'get_server_info' for detailed info vs. this for listing).

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

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