Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

update_client

Modify Keycloak client settings including ID, name, redirect URIs, and access permissions to maintain accurate identity management configurations.

Instructions

Update an existing client.

Args:
    id: The client's database ID
    client_id: New client ID
    name: New display name
    description: New description
    enabled: Whether the client is enabled
    redirect_uris: New redirect URIs
    web_origins: New CORS origins
    public_client: Whether client is public
    service_accounts_enabled: Enable service accounts
    direct_access_grants_enabled: Enable direct access grants
    realm: Target realm (uses default if not specified)

Returns:
    Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
client_idNo
nameNo
descriptionNo
enabledNo
redirect_urisNo
web_originsNo
public_clientNo
service_accounts_enabledNo
direct_access_grants_enabledNo
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implements the 'update_client' MCP tool: fetches the current client configuration from Keycloak, applies only the provided field updates, and performs a PUT request to update the client. The @mcp.tool() decorator registers it as an MCP tool. Input schema defined by function parameters and docstring.
    @mcp.tool()
    async def update_client(
        id: str,
        client_id: Optional[str] = None,
        name: Optional[str] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        redirect_uris: Optional[List[str]] = None,
        web_origins: Optional[List[str]] = None,
        public_client: Optional[bool] = None,
        service_accounts_enabled: Optional[bool] = None,
        direct_access_grants_enabled: Optional[bool] = None,
        realm: Optional[str] = None,
    ) -> Dict[str, str]:
        """
        Update an existing client.
    
        Args:
            id: The client's database ID
            client_id: New client ID
            name: New display name
            description: New description
            enabled: Whether the client is enabled
            redirect_uris: New redirect URIs
            web_origins: New CORS origins
            public_client: Whether client is public
            service_accounts_enabled: Enable service accounts
            direct_access_grants_enabled: Enable direct access grants
            realm: Target realm (uses default if not specified)
    
        Returns:
            Status message
        """
        # Get current client data
        current_client = await client._make_request("GET", f"/clients/{id}", realm=realm)
    
        # Update only provided fields
        if client_id is not None:
            current_client["clientId"] = client_id
        if name is not None:
            current_client["name"] = name
        if description is not None:
            current_client["description"] = description
        if enabled is not None:
            current_client["enabled"] = enabled
        if redirect_uris is not None:
            current_client["redirectUris"] = redirect_uris
        if web_origins is not None:
            current_client["webOrigins"] = web_origins
        if public_client is not None:
            current_client["publicClient"] = public_client
        if service_accounts_enabled is not None:
            current_client["serviceAccountsEnabled"] = service_accounts_enabled
        if direct_access_grants_enabled is not None:
            current_client["directAccessGrantsEnabled"] = direct_access_grants_enabled
    
        await client._make_request(
            "PUT", f"/clients/{id}", data=current_client, realm=realm
        )
        return {"status": "updated", "message": f"Client {id} updated successfully"}
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 'Update an existing client' implies a mutation operation, the description doesn't disclose important behavioral traits: whether this requires specific permissions, what happens when only some fields are provided (partial updates), whether changes are reversible, potential side effects, or rate limits. The 'Returns: Status message' is minimal but doesn't describe success/failure patterns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns) and uses bullet-like formatting. Each parameter explanation is brief but informative. The opening statement is front-loaded with the core purpose. While efficient, some sentences could be more concise (e.g., repetitive 'New' could be streamlined).

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?

For a mutation tool with 11 parameters, no annotations, and an output schema (though unspecified), the description is moderately complete. It covers all parameters well but lacks behavioral context about permissions, partial updates, and error handling. The presence of an output schema means the description doesn't need to detail return values, but more operational guidance would be helpful for a complex update operation.

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

Parameters5/5

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

With 0% schema description coverage for 11 parameters, the description provides excellent compensation by listing all parameters with brief explanations of what each represents. It clarifies that 'id' is the database ID (not client_id), explains what each field controls (e.g., 'enabled: Whether the client is enabled'), and notes that 'realm' uses a default if not specified. This adds significant meaning beyond the bare schema.

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 'Update an existing client' which is a specific verb+resource combination. It distinguishes this from sibling tools like 'create_client' and 'delete_client' by specifying it updates existing clients rather than creating or deleting them. However, it doesn't explicitly differentiate from other update tools like 'update_user' or 'update_group' beyond the resource type.

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. It doesn't mention prerequisites (like needing to know the client ID), doesn't specify when to use this versus 'create_client' or 'delete_client', and offers no context about appropriate scenarios for client updates. The agent must infer usage from the tool name alone.

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/idoyudha/mcp-keycloak'

If you have feedback or need assistance with the MCP directory API, please join our Discord server