list-realms
Retrieve all available realms from the Keycloak identity and access management server to manage authentication and authorization configurations.
Instructions
List all available realms
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list-realms"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:156-165 (handler)Handler implementation for the 'list-realms' tool. Fetches all realms from Keycloak using kcAdminClient.realms.find() and returns a formatted text list.
case "list-realms": { const realms = await kcAdminClient.realms.find(); return { content: [{ type: "text", text: `Available realms:\n${realms.map(r => `- ${r.realm}`).join('\n')}` }] }; } - src/index.ts:74-82 (registration)Registration of the 'list-realms' tool in the ListToolsRequestHandler response, defining name, description, and empty input schema.
{ name: "list-realms", description: "List all available realms", inputSchema: { type: "object", properties: {}, required: [] } }, - src/index.ts:77-81 (schema)Input schema for the 'list-realms' tool, which requires no parameters (empty object).
inputSchema: { type: "object", properties: {}, required: [] }