list_cloud_resources
Retrieve and filter cloud resources from AWS, GCP, Azure, or Linode to identify security risks and compliance issues in your environment.
Instructions
List cloud resources for a specific provider with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| provider | Yes | Cloud provider (aws, gcp, azure, linode) | |
| filters | No | Filter string (e.g., 'resource_type:EC2NetworkInterface,resource_type:SQSQueue,aws_account:123456789012,compliance:not_compliant') | |
| offset | No | Pagination offset. Default: 0 | |
| limit | No | Maximum number of results to return | |
| q | No | Free text search query |
Implementation Reference
- src/operations/cloud-inventory.ts:38-62 (handler)The main handler function that implements the core logic of the 'list_cloud_resources' tool. It constructs API parameters and calls the RadSecurityClient to fetch cloud resources.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, used for validation in registration.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:194-200 (registration)Registration of the tool in the ListTools response, specifying name, description, and input schema.name: "list_cloud_resources", description: "List cloud resources for a specific provider with optional filtering", inputSchema: zodToJsonSchema( cloudInventory.ListCloudResourcesSchema ), },
- src/index.ts:838-854 (registration)Handler dispatch in the CallToolRequest switch case, where input is validated and the cloudInventory.listCloudResources function is invoked.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) }, ], };