Skip to main content
Glama
wowjinxy
by wowjinxy

delete_role

Remove a role from a Discord server to manage permissions and organize members. Specify role ID and optional server ID with reason for deletion.

Instructions

Delete a role from the server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
role_idYes
server_idNo
reasonNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes the delete_role tool by fetching the guild and role, checking if role exists, deleting it, and returning confirmation.
    async def handle_delete_role(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Delete a role"""
        guild = await discord_client.fetch_guild(int(arguments["server_id"]))
        role = guild.get_role(int(arguments["role_id"]))
        
        if not role:
            return [TextContent(type="text", text="Role not found")]
        
        role_name = role.name
        await role.delete(reason=arguments.get("reason", "Role deleted via MCP"))
        
        return [TextContent(
            type="text",
            text=f"Deleted role '{role_name}' from {guild.name}"
        )]
  • Registers the delete_role tool in the MCP server's list_tools() with its name, description, and input schema.
    Tool(
        name="delete_role",
        description="Delete a role from the server",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {"type": "string", "description": "Server ID"},
                "role_id": {"type": "string", "description": "Role ID to delete"},
                "reason": {"type": "string", "description": "Reason for deletion"}
            },
            "required": ["server_id", "role_id"]
        }
    ),
  • Defines the input schema for the delete_role tool, specifying required server_id and role_id parameters.
    inputSchema={
        "type": "object",
        "properties": {
            "server_id": {"type": "string", "description": "Server ID"},
            "role_id": {"type": "string", "description": "Role ID to delete"},
            "reason": {"type": "string", "description": "Reason for deletion"}
        },
        "required": ["server_id", "role_id"]
    }
  • Includes 'delete_role' in the list of advanced tools routed to AdvancedToolHandlers.handle_* methods.
    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"
    ]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Delete' implies a destructive, irreversible action, it doesn't specify required permissions, whether deletion is permanent, what happens to users with that role, or any rate limits. This is inadequate for a destructive operation with zero annotation coverage.

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, direct sentence with zero wasted words. It's appropriately sized for a simple action and front-loads the core purpose immediately, making it easy to parse quickly.

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?

For a destructive tool with no annotations, 0% schema coverage, and three parameters, the description is incomplete. It lacks crucial context about permissions, irreversible consequences, parameter usage, and how it differs from siblings. While an output schema exists, the description should still address behavioral aspects given the tool's complexity and potential impact.

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?

Schema description coverage is 0%, so the description must compensate but fails to do so. It mentions no parameters at all, leaving all three (role_id, server_id, reason) undocumented. The description adds no meaning beyond what the bare schema provides, which is insufficient given the low coverage.

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 ('Delete') and resource ('a role from the server'), making the purpose immediately understandable. It distinguishes from siblings like 'remove_role' by specifying deletion rather than removal, though it doesn't explicitly contrast with similar tools like 'edit_role' or 'create_role'.

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 like 'remove_role' or 'edit_role', nor does it mention prerequisites, permissions, or consequences. It simply states what the tool does without context for appropriate usage scenarios.

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