Skip to main content
Glama

list_servers

Retrieve detailed information about all Discord servers accessible to the bot, including server name, ID, member count, and creation date, for effective management and monitoring.

Instructions

Get a list of all Discord servers the bot has access to with their details such as name, id, member count, and creation date.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • Handler for the 'list_servers' tool. Loops through all Discord guilds (servers) the bot is in, collects id, name, member count, and creation date, then formats and returns them as a text content list.
    elif name == "list_servers": servers = [] for guild in discord_client.guilds: servers.append({ "id": str(guild.id), "name": guild.name, "member_count": guild.member_count, "created_at": guild.created_at.isoformat() }) return [TextContent( type="text", text=f"Available Servers ({len(servers)}):\n" + "\n".join(f"{s['name']} (ID: {s['id']}, Members: {s['member_count']})" for s in servers) )]
  • Registration of the 'list_servers' tool in the @app.list_tools() handler, including its schema (no required inputs).
    Tool( name="list_servers", description="Get a list of all Discord servers the bot has access to with their details such as name, id, member count, and creation date.", inputSchema={ "type": "object", "properties": {}, "required": [] } )

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