Skip to main content
Glama
rad-security

RAD Security

Official
by rad-security

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
NameRequiredDescriptionDefault
identity_typesNoIdentity types to get
cluster_idsNoCluster IDs to get identities for
pageNoPage number to get. Default: 1
page_sizeNoPage size to get. Default: 10
qNoQuery to filter identities

Implementation Reference

  • 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;
    }
  • 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";

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/rad-security/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server