list_cloud_resources
List and filter cloud resources across AWS, GCP, Azure, and Linode for security insights with pagination and search capabilities. Integrates with RAD Security for Kubernetes and cloud environment analysis.
Instructions
List cloud resources for a specific provider with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Filter string (e.g., 'resource_type:EC2NetworkInterface,resource_type:SQSQueue,aws_account:123456789012,compliance:not_compliant') | |
| limit | No | Maximum number of results to return | |
| offset | No | Pagination offset. Default: 0 | |
| provider | Yes | Cloud provider (aws, gcp, azure, linode) | |
| q | No | Free text search query |
Implementation Reference
- src/operations/cloud-inventory.ts:38-62 (handler)The main handler function that executes the logic to list cloud resources for a given provider using the RadSecurityClient's makeRequest method.export async function listCloudResources( client: RadSecurityClient, provider: ProviderType, filters?: string, offset?: number, limit: number = 20, q?: string ): Promise<any> { const params: Record<string, any> = { limit }; if (filters) { params.filter = filters; } if (offset !== undefined) { params.offset = offset; } if (q) { params.q = q; } return client.makeRequest( `/accounts/${client.getAccountId()}/cloud-inventory/v1/${provider}`, params ); }
- Zod schema defining the input parameters for the list_cloud_resources tool, including provider, filters, offset, limit, and query.// Schema for list_cloud_resources export const ListCloudResourcesSchema = z.object({ provider: ProviderTypeEnum.describe("Cloud provider (aws, gcp, azure, linode)"), filters: z.string().optional().describe("Filter string (e.g., 'resource_type:EC2NetworkInterface,resource_type:SQSQueue,aws_account:123456789012,compliance:not_compliant')"), offset: z.number().optional().describe("Pagination offset. Default: 0"), limit: z.number().optional().default(20).describe("Maximum number of results to return"), q: z.string().optional().describe("Free text search query"), });
- src/index.ts:162-166 (registration)Tool registration in the listTools handler, defining the name, description, and input schema for list_cloud_resources.{ name: "list_cloud_resources", description: "List cloud resources for a specific provider with optional filtering", inputSchema: zodToJsonSchema(cloudInventory.ListCloudResourcesSchema), },
- src/index.ts:469-481 (registration)Dispatcher case in the CallToolRequest handler that parses arguments and calls the listCloudResources function.case "list_cloud_resources": { const args = cloudInventory.ListCloudResourcesSchema.parse(request.params.arguments); const response = await cloudInventory.listCloudResources( client, args.provider, args.filters, args.offset, args.limit, args.q ); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], };