list_identities
Retrieve and filter identities in a Kubernetes cluster, including service accounts, users, and groups, using cluster IDs and pagination options for organized access.
Instructions
Get list of identities for a specific Kubernetes cluster
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cluster_ids | No | Cluster IDs to get identities for | |
| identity_types | No | Identity types to get | |
| 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 core handler function implementing the list_identities tool logic by querying the RAD Security API with provided filters.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 input schema for validating arguments to 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:141-145 (registration)Tool registration in the MCP listTools request handler, defining name, description, and schema.{ name: "list_identities", description: "Get list of identities for a specific Kubernetes cluster", inputSchema: zodToJsonSchema(identities.ListIdentitiesSchema), },
- src/index.ts:437-442 (registration)Dispatch handler in the MCP CallToolRequest that parses arguments and invokes the listIdentities function.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) }], };