Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

regenerate_client_secret

Generate a new client secret for Keycloak authentication clients to enhance security by replacing compromised or outdated credentials.

Instructions

Regenerate the client secret.

Args:
    id: The client's database ID
    realm: Target realm (uses default if not specified)

Returns:
    New client secret object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'regenerate_client_secret' tool. It regenerates the client secret by making a POST request to the Keycloak Admin API endpoint `/clients/{id}/client-secret` using the KeycloakClient instance.
    @mcp.tool()
    async def regenerate_client_secret(
        id: str, realm: Optional[str] = None
    ) -> Dict[str, str]:
        """
        Regenerate the client secret.
    
        Args:
            id: The client's database ID
            realm: Target realm (uses default if not specified)
    
        Returns:
            New client secret object
        """
        return await client._make_request(
            "POST", f"/clients/{id}/client-secret", realm=realm
        )
  • The @mcp.tool() decorator registers the 'regenerate_client_secret' function as an MCP tool.
    @mcp.tool()
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. It states the action 'regenerate' implies mutation and destruction of the old secret, but fails to mention critical details like authentication requirements, rate limits, whether the old secret becomes invalid immediately, or any side effects. This is a significant gap for a mutation tool 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.

Conciseness4/5

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

The description is appropriately sized and front-loaded with the main action, followed by structured sections for Args and Returns. Each sentence earns its place by providing essential information without unnecessary elaboration, though the lack of usage context slightly reduces efficiency.

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?

Given the tool's complexity as a mutation with 2 parameters and an output schema, the description is moderately complete. It covers the basic action and parameters but lacks behavioral details like side effects or authentication needs. The presence of an output schema means it doesn't need to explain return values, but overall completeness is adequate with clear gaps.

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

Parameters3/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. It adds meaning by explaining 'id' as 'The client's database ID' and 'realm' as 'Target realm (uses default if not specified)', which clarifies semantics beyond the bare schema. However, it doesn't cover details like format constraints or examples, leaving some gaps in parameter understanding.

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 'regenerate' and the resource 'client secret', making the purpose specific and understandable. It distinguishes this tool from sibling tools like 'get_client_secret' (which retrieves) and 'create_client' (which creates), though it doesn't explicitly mention these distinctions in the description itself.

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 'get_client_secret' or 'create_client', nor does it mention prerequisites such as needing the client's ID. It lacks context about typical use cases or exclusions, leaving usage unclear beyond the basic action.

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