list_identities
Retrieve Kubernetes cluster identities including service accounts, users, and groups to manage access control and security policies.
Instructions
Get list of identities for a specific Kubernetes cluster
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identity_types | No | Identity types to get | |
| cluster_ids | No | Cluster IDs to get identities for | |
| page | No | Page number to get. Default: 1 | |
| page_size | No | Page size to get. Default: 10 | |
| q | No | Query to filter identities |
Implementation Reference
- src/operations/identities.ts:19-39 (handler)The handler function that executes the core logic for the 'list_identities' tool. It makes an API request to the RAD Security backend to fetch identities based on provided filters like identity_types, cluster_ids, pagination, and query.export async function listIdentities( client: RadSecurityClient, identityTypes: IdentityType[] = [], clusterIds: string[] = [], page: number = 1, page_size: number = 10, q: string = "", ): Promise<any> { const identities = await client.makeRequest( `/accounts/${client.getAccountId()}/identities`, { identity_types: identityTypes.join(","), identity_sources: clusterIds.join(","), page, page_size, q, } ); return identities; }
- src/operations/identities.ts:7-13 (schema)Zod schema defining the input parameters and validation for the 'list_identities' tool.export const ListIdentitiesSchema = z.object({ identity_types: z.array(IdentityTypeEnum).optional().describe("Identity types to get"), cluster_ids: z.array(z.string()).optional().describe("Cluster IDs to get identities for"), page: z.number().optional().describe("Page number to get. Default: 1"), page_size: z.number().optional().describe("Page size to get. Default: 10"), q: z.string().optional().describe("Query to filter identities"), });
- src/index.ts:163-178 (registration)Registration of the 'list_identities' tool in the ListToolsRequest handler, including name, description, and input schema for tool discovery....(isToolkitEnabled("identities", toolkitFilters) ? [ { name: "list_identities", description: "Get list of identities for a specific Kubernetes cluster", inputSchema: zodToJsonSchema(identities.ListIdentitiesSchema), }, { name: "get_identity_details", description: "Get detailed information about a specific identity in a Kubernetes cluster", inputSchema: zodToJsonSchema(identities.GetIdentityDetailsSchema), }, ] : []),
- src/index.ts:784-801 (registration)Dispatch handler in the CallToolRequest switch statement that validates input with ListIdentitiesSchema, calls the listIdentities function, and formats the response for MCP.case "list_identities": { const args = identities.ListIdentitiesSchema.parse( request.params.arguments ); const response = await identities.listIdentities( client, args.identity_types, args.cluster_ids, args.page, args.page_size, args.q ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], }; }
- src/index.ts:23-23 (registration)Import of the identities module containing the handler and schema for list_identities.import * as identities from "./operations/identities.js";