Skip to main content
Glama
wowjinxy
by wowjinxy

create_invite

Generate invite links for Discord channels with customizable expiration, usage limits, and temporary access options.

Instructions

Create an invite link for a channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
max_age_secondsNo
max_usesNo
temporaryNo
uniqueNo
reasonNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function `handle_create_invite` that implements the core logic: fetches the target channel, constructs invite parameters (max_age, max_uses, temporary, unique, reason), calls `channel.create_invite()`, and returns the invite URL with details.
    @staticmethod
    async def handle_create_invite(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Create an invite link"""
        channel = await discord_client.fetch_channel(int(arguments["channel_id"]))
        
        kwargs = {
            "reason": arguments.get("reason", "Invite created via MCP")
        }
        
        if "max_age" in arguments:
            kwargs["max_age"] = arguments["max_age"]
        if "max_uses" in arguments:
            kwargs["max_uses"] = arguments["max_uses"]
        if "temporary" in arguments:
            kwargs["temporary"] = arguments["temporary"]
        if "unique" in arguments:
            kwargs["unique"] = arguments["unique"]
        
        invite = await channel.create_invite(**kwargs)
    
        max_age = kwargs.get("max_age", 0)
        expires_text = "Never" if max_age == 0 else f"{max_age} seconds"
    
        return [TextContent(
            type="text",
            text=(
                f"Created invite for #{channel.name}: {invite.url}\n"
                f"Code: {invite.code}\n"
                f"Expires: {expires_text}"
            )
        )]
  • The input schema definition for the `create_invite` tool within the `list_tools()` function, specifying parameters and validation rules.
    Tool(
        name="create_invite",
        description="Create a custom invite link",
        inputSchema={
            "type": "object",
            "properties": {
                "channel_id": {"type": "string", "description": "Channel ID"},
                "max_age": {"type": "number", "description": "Max age in seconds (0 = never expires)"},
                "max_uses": {"type": "number", "description": "Max uses (0 = unlimited)"},
                "temporary": {"type": "boolean", "description": "Grant temporary membership"},
                "unique": {"type": "boolean", "description": "Create unique invite"},
                "reason": {"type": "string", "description": "Reason for creation"}
            },
            "required": ["channel_id"]
        }
    ),
  • Registration and dispatch logic in `@app.call_tool()`: `create_invite` is listed in `advanced_tool_names` and routed to `AdvancedToolHandlers.handle_create_invite`.
    advanced_tool_names = [
        "edit_server_settings", "create_server_template", "create_channel_category",
        "create_voice_channel", "create_stage_channel", "create_forum_channel",
        "create_announcement_channel", "edit_channel", "set_channel_permissions",
        "create_role", "edit_role", "delete_role", "create_role_hierarchy",
        "create_emoji", "create_webhook", "send_webhook_message",
        "ban_member", "kick_member", "timeout_member", "bulk_delete_messages",
        "create_scheduled_event", "create_invite", "create_thread", "create_automod_rule"
    ]
    
    if name in advanced_tool_names:
        handler_method = f"handle_{name}"
        if hasattr(AdvancedToolHandlers, handler_method):
            return await getattr(AdvancedToolHandlers, handler_method)(discord_client, arguments)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't disclose important behavioral traits: what permissions are required, whether the invite link is permanent or temporary by default, what happens on success/failure, rate limits, or security implications. For a tool that creates access credentials, this is a significant transparency gap.

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 maximally concise - a single sentence with zero wasted words. It's front-loaded with the core purpose and contains no unnecessary elaboration. While this conciseness comes at the cost of completeness, as a standalone statement it's efficiently structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, 1 required), complete lack of annotations, 0% schema description coverage, and the fact that it creates access credentials, the description is severely incomplete. While an output schema exists (which helps with return values), the description doesn't provide the contextual information needed to understand when, why, or how to use this tool effectively, nor does it explain parameter meanings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for all 6 parameters, the description provides no parameter semantics whatsoever. It doesn't explain what 'channel_id' refers to, what 'max_age_seconds' controls, what 'temporary' and 'unique' mean in this context, or what 'reason' is used for. The description fails to compensate for the complete lack of schema documentation.

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 action ('Create an invite link') and the target resource ('for a channel'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from potential alternatives like 'list_invites' or explain what makes 'create_invite' unique among sibling tools that also involve channel operations.

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. There's no mention of prerequisites (like permissions needed), when this is appropriate versus other invitation methods, or how it relates to sibling tools like 'list_invites' or channel management tools. The agent receives no contextual usage information.

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