Skip to main content
Glama
wowjinxy
by wowjinxy

edit_role

Modify Discord role settings like name, color, permissions, and visibility to customize server member access and organization.

Instructions

Update the configuration of an existing role.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
role_idYes
server_idNo
nameNo
colorNo
colourNo
hoistNo
mentionableNo
permissionsNo
permissions_valueNo
positionNo
unicode_emojiNo
reasonNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function that implements the edit_role tool. It fetches the guild and role, collects changes to name, color, permissions, hoist, mentionable, position, and reason, then edits the role and returns a summary of changes.
    async def handle_edit_role(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Edit an existing 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")]
        
        edit_kwargs = {}
        changes_made = []
        
        if "name" in arguments:
            edit_kwargs["name"] = arguments["name"]
            changes_made.append(f"Name: {arguments['name']}")
        
        if "color" in arguments:
            edit_kwargs["color"] = hex_to_color(arguments["color"])
            changes_made.append(f"Color: {arguments['color']}")
        
        if "permissions" in arguments:
            edit_kwargs["permissions"] = parse_permissions(arguments["permissions"])
            changes_made.append("Permissions updated")
        
        if "hoist" in arguments:
            edit_kwargs["hoist"] = arguments["hoist"]
            changes_made.append(f"Hoisted: {arguments['hoist']}")
        
        if "mentionable" in arguments:
            edit_kwargs["mentionable"] = arguments["mentionable"]
            changes_made.append(f"Mentionable: {arguments['mentionable']}")
        
        if "position" in arguments:
            edit_kwargs["position"] = arguments["position"]
            changes_made.append(f"Position: {arguments['position']}")
        
        edit_kwargs["reason"] = arguments.get("reason", "Role updated via MCP")
        
        if edit_kwargs:
            await role.edit(**edit_kwargs)
        
        return [TextContent(
            type="text",
            text=f"Updated role '{role.name}':\n• " + "\n• ".join(changes_made)
        )]
  • The input schema defining parameters for the edit_role tool, including required server_id and role_id, and optional properties for editing.
    Tool(
        name="edit_role",
        description="Edit an existing role's properties and permissions",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {"type": "string", "description": "Server ID"},
                "role_id": {"type": "string", "description": "Role ID"},
                "name": {"type": "string", "description": "New role name"},
                "color": {"type": "string", "description": "New role color (hex)"},
                "permissions": {"type": "array", "items": {"type": "string"}, "description": "New permissions"},
                "hoist": {"type": "boolean", "description": "Whether role is displayed separately"},
                "mentionable": {"type": "boolean", "description": "Whether role is mentionable"},
                "position": {"type": "number", "description": "New role position"},
                "reason": {"type": "string", "description": "Reason for edit"}
            },
            "required": ["server_id", "role_id"]
        }
    ),
  • The dynamic dispatch/registration code in call_tool that routes 'edit_role' calls (as part of advanced_tool_names) to AdvancedToolHandlers.handle_edit_role.
    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 but only states it's an update operation. It doesn't disclose behavioral traits like whether this requires specific permissions, is destructive (e.g., overwrites existing settings), has rate limits, or what happens to unspecified fields (e.g., partial vs. full updates). For a mutation tool with 12 parameters, this is a significant 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 a single, efficient sentence with no wasted words. It's front-loaded with the core action ('Update') and resource ('role'), making it easy to parse quickly. Every word earns its place by conveying the essential purpose.

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 complexity (12 parameters, mutation operation, no annotations) and the presence of an output schema (which might cover return values), the description is incomplete. It doesn't address key contextual aspects like permission requirements, update behavior, or parameter details, leaving the agent under-informed for a tool with many configuration options.

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

Parameters1/5

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

The description adds no parameter semantics beyond the generic 'configuration'. With 12 parameters and 0% schema description coverage, the schema titles (e.g., 'Role Id', 'Color', 'Permissions') provide minimal context. The description fails to explain what fields can be updated, their formats, or interactions (e.g., 'color' vs. 'colour'), leaving parameters largely undocumented.

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 ('Update') and resource ('configuration of an existing role'), making the purpose unambiguous. However, it doesn't differentiate this from sibling tools like 'update_channel' or 'create_role' beyond mentioning 'existing role', which is implied by 'edit' in the name.

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 'create_role' or 'delete_role', nor does it mention prerequisites (e.g., needing admin permissions) or context (e.g., server-specific vs. global roles). It only states what the tool does, not when to invoke it.

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