Skip to main content
Glama

create_category

Organize Discord server channels by creating new categories to group related channels together for better structure and navigation.

Instructions

Create a new channel category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
server_idNo
positionNo
reasonNo

Implementation Reference

  • The handler and registration for the 'create_category' MCP tool. This function creates a new Discord category channel by calling guild.create_category() with the provided parameters.
    async def create_category( name: str, server_id: str | int | None = None, position: int | None = None, reason: str | None = None, ctx: Context = None, ) -> str: # type: ignore[override] """Create a new channel category.""" assert ctx is not None bot, config = await _acquire(ctx) guild_id = _resolve_guild_id(config, server_id) guild = await _ensure_guild(bot, guild_id) kwargs: dict[str, object] = {"name": name} if position is not None: kwargs["position"] = int(position) category = await _call_discord( "create category", guild.create_category(reason=reason, **kwargs), ) return f"Created category {category.name} (ID: {category.id})."
  • The @server.tool() decorator registers the create_category function as an MCP tool with the name 'create_category'.
    async def create_category( name: str, server_id: str | int | None = None, position: int | None = None, reason: str | None = None, ctx: Context = None, ) -> str: # type: ignore[override] """Create a new channel category.""" assert ctx is not None bot, config = await _acquire(ctx) guild_id = _resolve_guild_id(config, server_id) guild = await _ensure_guild(bot, guild_id) kwargs: dict[str, object] = {"name": name} if position is not None: kwargs["position"] = int(position) category = await _call_discord( "create category", guild.create_category(reason=reason, **kwargs), ) return f"Created category {category.name} (ID: {category.id})."
  • Alternative handler implementation in advanced tools for creating categories, called as 'create_channel_category' in integrated_server.py.
    async def handle_create_channel_category(discord_client, arguments: Dict[str, Any]) -> List[TextContent]: """Create a channel category""" guild = await discord_client.fetch_guild(int(arguments["server_id"])) kwargs = { "name": arguments["name"], "reason": arguments.get("reason", "Category created via MCP") } if "position" in arguments: kwargs["position"] = arguments["position"] category = await guild.create_category(**kwargs) return [TextContent( type="text", text=f"Created category '{category.name}' (ID: {category.id}) in {guild.name}" )]

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