Skip to main content
Glama
hanweg

mcp-discord

by hanweg

get_server_info

Retrieve detailed information about a Discord server by providing its server ID, enabling efficient management and integration with MCP clients.

Instructions

Get information about a Discord server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesDiscord server (guild) ID

Implementation Reference

  • Handler implementation for the 'get_server_info' tool within the call_tool function. Fetches Discord guild information using the provided server_id and returns formatted text content.
    elif name == "get_server_info":
        guild = await discord_client.fetch_guild(int(arguments["server_id"]))
        info = {
            "name": guild.name,
            "id": str(guild.id),
            "owner_id": str(guild.owner_id),
            "member_count": guild.member_count,
            "created_at": guild.created_at.isoformat(),
            "description": guild.description,
            "premium_tier": guild.premium_tier,
            "explicit_content_filter": str(guild.explicit_content_filter)
        }
        return [TextContent(
            type="text",
            text=f"Server Information:\n" + "\n".join(f"{k}: {v}" for k, v in info.items())
        )]
  • Registration of the 'get_server_info' tool in the list_tools() function, defining its name, description, and input schema requiring a 'server_id' string.
    Tool(
        name="get_server_info",
        description="Get information about a Discord server",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {
                    "type": "string",
                    "description": "Discord server (guild) ID"
                }
            },
            "required": ["server_id"]
        }
    ),

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