Skip to main content
Glama
wowjinxy
by wowjinxy

get_channels

List Discord server channels organized by category to view and manage channel structure. Retrieve channel information using server ID.

Instructions

List channels for a Discord server grouped by category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation of the get_channels tool. Fetches guild channels, organizes by category, formats output with emojis and details.
    async def handle_get_channels(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Get channels in a server"""
        guild = await discord_client.fetch_guild(int(arguments["server_id"]))
        
        # Organize channels by category
        categories = {}
        uncategorized = []
        
        for channel in guild.channels:
            if isinstance(channel, discord.CategoryChannel):
                categories[channel.name] = {
                    "id": channel.id,
                    "channels": []
                }
            elif channel.category:
                if channel.category.name not in categories:
                    categories[channel.category.name] = {
                        "id": channel.category.id,
                        "channels": []
                    }
                categories[channel.category.name]["channels"].append({
                    "name": channel.name,
                    "id": channel.id,
                    "type": str(channel.type)
                })
            else:
                uncategorized.append({
                    "name": channel.name,
                    "id": channel.id,
                    "type": str(channel.type)
                })
        
        # Format the output
        result = f"**Channels in {guild.name}:**\n\n"
        
        # Add categorized channels
        for cat_name, cat_data in categories.items():
            if cat_data["channels"]:  # Only show categories with channels
                result += f"**📁 {cat_name}** (ID: {cat_data['id']})\n"
                for channel in cat_data["channels"]:
                    emoji = "🔊" if "voice" in channel["type"] else "💬"
                    result += f"  {emoji} {channel['name']} (ID: {channel['id']}) - {channel['type']}\n"
                result += "\n"
        
        # Add uncategorized channels
        if uncategorized:
            result += "**📋 Uncategorized:**\n"
            for channel in uncategorized:
                emoji = "🔊" if "voice" in channel["type"] else "💬"
                result += f"  {emoji} {channel['name']} (ID: {channel['id']}) - {channel['type']}\n"
        
        return [TextContent(type="text", text=result)]
  • Registers the get_channels tool in the MCP server via @app.list_tools(), defining name, description, and input schema.
    Tool(
        name="get_channels",
        description="Get a organized list of all channels in a Discord server",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {
                    "type": "string",
                    "description": "Discord server (guild) ID"
                }
            },
            "required": ["server_id"]
        }
    ),
  • Routes get_channels tool calls to CoreToolHandlers.handle_get_channels via dynamic getattr in the main @app.call_tool() handler.
    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)
  • Input schema definition requiring 'server_id' as string for the get_channels tool.
    inputSchema={
        "type": "object",
        "properties": {
            "server_id": {
                "type": "string",
                "description": "Discord server (guild) ID"
            }
        },
        "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 the full burden of behavioral disclosure. It mentions grouping by category, which adds some context, but fails to describe key behaviors like whether it requires authentication, rate limits, error handling, or the format of the output (though an output schema exists). For a read operation with zero annotation coverage, this is insufficient.

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 front-loads the core action ('List channels') and includes essential detail ('grouped by category'). There is no wasted verbiage, making it highly concise and well-structured.

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?

Given the tool's low complexity (1 optional parameter) and the presence of an output schema, the description is minimally adequate. However, with no annotations and low schema coverage, it should provide more context on usage and behavior to be fully complete, leaving gaps in guidance and transparency.

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 0%, so the description must compensate. It implies a 'server_id' parameter by mentioning 'Discord server', but does not explain its purpose, format, or that it's optional (default null). The description adds minimal semantic value beyond the schema, resulting in a baseline score.

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 verb ('List') and resource ('channels for a Discord server'), and specifies grouping ('grouped by category'), which adds useful detail. However, it does not explicitly differentiate from sibling tools like 'list_servers' or 'get_server_info', which reduces it from 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, such as 'list_servers' for server-level information or 'get_server_info' for server details. It lacks context on prerequisites, exclusions, or comparisons to sibling tools, leaving usage unclear.

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