list_containers
Retrieve and filter containers secured by RAD Security using image name, digest, namespace, cluster ID, or free text search to monitor Kubernetes security.
Instructions
List containers secured by RAD Security with optional filtering by image name, image digest, namespace, cluster_id, or free text search
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Filter string (e.g., 'image_name:nginx' or 'image_digest:sha256:...' or 'owner_namespace:namespace' or 'cluster_id:cluster_id'). Multiple filters can be combined with commas. | |
| offset | No | Pagination offset. Default: 0 | |
| limit | No | Maximum number of results to return. Default: 20 | |
| q | No | Free text search query |
Implementation Reference
- src/operations/containers.ts:15-31 (handler)The handler function that executes the logic for listing containers by making an API request to the RAD Security client and processing the response.export async function listContainers( client: RadSecurityClient, offset: number = 0, limit: number = 20, filters?: string, q?: string ): Promise<any> { const params: Record<string, any> = { limit, offset, filters, q }; const response = await client.makeRequest(`/accounts/${client.getAccountId()}/inventory_containers`, params); // Remove "id" from each container to avoid confusion response.entries.forEach((container: any) => { delete container.id; }); return response; }
- src/operations/containers.ts:4-9 (schema)Zod schema defining the input parameters for the list_containers tool.export const ListContainersSchema = z.object({ filters: z.string().optional().describe("Filter string (e.g., 'image_name:nginx' or 'image_digest:sha256:...' or 'owner_namespace:namespace' or 'cluster_id:cluster_id'). Multiple filters can be combined with commas."), offset: z.number().optional().describe("Pagination offset. Default: 0"), limit: z.number().optional().describe("Maximum number of results to return. Default: 20"), q: z.string().optional().describe("Free text search query"), });
- src/index.ts:130-135 (registration)Registration of the list_containers tool in the listTools handler, including name, description, and schema.{ name: "list_containers", description: "List containers secured by RAD Security with optional filtering by image name, image digest, namespace, cluster_id, or free text search", inputSchema: zodToJsonSchema(containers.ListContainersSchema), },
- src/index.ts:722-737 (registration)Dispatch handler in the callToolRequest that parses arguments, calls the listContainers function, and returns the response for the list_containers tool.case "list_containers": { const args = containers.ListContainersSchema.parse( request.params.arguments ); const response = await containers.listContainers( client, args.offset, args.limit, args.filters, args.q ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], };