Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

get_client

Retrieve a specific Keycloak client configuration using its database ID. Specify a realm to access clients across different authentication domains.

Instructions

Get a specific client by database ID.

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

Returns:
    Client object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'get_client' MCP tool. It is decorated with @mcp.tool() for registration and retrieves a specific Keycloak client by its database ID.
    @mcp.tool()
    async def get_client(id: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific client by database ID.
    
        Args:
            id: The client's database ID (not client_id)
            realm: Target realm (uses default if not specified)
    
        Returns:
            Client object
        """
        return await client._make_request("GET", f"/clients/{id}", realm=realm)
  • The @mcp.tool() decorator registers the get_client function as an MCP tool.
    @mcp.tool()
  • The function signature and docstring define the input schema (id: str required, realm: Optional[str]) and output (Dict[str, Any]) for the tool.
    async def get_client(id: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific client by database ID.
    
        Args:
            id: The client's database ID (not client_id)
            realm: Target realm (uses default if not specified)
    
        Returns:
            Client object
        """
        return await client._make_request("GET", f"/clients/{id}", realm=realm)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool retrieves a client object but lacks details on permissions, error handling, rate limits, or whether it's a read-only operation. This leaves behavioral traits unclear for a tool that likely requires authentication.

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 well-structured with a clear purpose statement followed by 'Args:' and 'Returns:' sections. Each sentence adds value without redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's low complexity (2 parameters, no nested objects) and the presence of an output schema (which handles return values), the description is mostly complete. It covers parameter semantics well but lacks behavioral context like auth needs, which is a minor gap.

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?

The description adds significant meaning beyond the input schema, which has 0% coverage. It explains that 'id' is the 'database ID (not client_id)', clarifying a potential confusion, and notes 'realm' uses a default if not specified. This fully compensates for the schema's lack of descriptions.

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 tool's purpose: 'Get a specific client by database ID.' It uses a specific verb ('Get') and resource ('client'), but does not explicitly distinguish it from sibling tools like 'get_client_by_clientid' or 'list_clients', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'by database ID (not client_id)', which suggests when to use this tool vs. 'get_client_by_clientid'. However, it does not explicitly mention alternatives like 'list_clients' for multiple clients or provide clear exclusions, keeping it at an implied level.

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