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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_servers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/discord_mcp/server.py:594-608 (handler)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) )] - src/discord_mcp/server.py:355-363 (registration)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": [] } )