ras_infra_get_providers
List all configured cloud and hypervisor providers in a Parallels RAS farm to verify connectivity, check provider types, or audit multi-cloud configurations.
Instructions
List all cloud and hypervisor providers configured in the RAS farm, including AVD, AWS EC2, Azure, Hyper-V, Nutanix, vCenter, and VMware ESXi. Use this to verify provider connectivity, check provider types, or audit multi-cloud config.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/infrastructure.ts:65-84 (registration)Tool registration with schema definition (title, description, read-only annotations, empty inputSchema) and handler for 'ras_infra_get_providers'server.registerTool( "ras_infra_get_providers", { title: "Providers", description: "List all cloud and hypervisor providers configured in the RAS farm, including " + "AVD, AWS EC2, Azure, Hyper-V, Nutanix, vCenter, and VMware ESXi. Use this to " + "verify provider connectivity, check provider types, or audit multi-cloud config.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {}, }, async () => { try { const data = await rasClient.get("/api/infrastructure/providers"); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (err) { return { content: [{ type: "text" as const, text: sanitiseError(err, "Failed to retrieve providers") }], isError: true }; } } );
- src/tools/infrastructure.ts:76-83 (handler)Handler function that executes the tool logic - makes GET request to /api/infrastructure/providers endpoint and returns JSON dataasync () => { try { const data = await rasClient.get("/api/infrastructure/providers"); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (err) { return { content: [{ type: "text" as const, text: sanitiseError(err, "Failed to retrieve providers") }], isError: true }; } }
- src/client.ts:128-166 (helper)RasClient.get() method - handles authentication, makes HTTP GET requests to RAS API with automatic retry on 401 errors and request timeoutsasync get(path: string): Promise<unknown> { // Ensure we have a valid session if (!this.authToken) { await this.login(); } const fetchOptions = { method: "GET" as const, headers: { ...this.headers, auth_token: this.authToken!, }, signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS), }; let response = await fetch(`${this.baseUrl}${path}`, fetchOptions); // Token may have expired — re-authenticate once and retry if (response.status === 401) { await this.login(); response = await fetch(`${this.baseUrl}${path}`, { ...fetchOptions, headers: { ...this.headers, auth_token: this.authToken!, }, signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS), }); } if (!response.ok) { const body = await response.text(); throw new Error( `RAS API error (HTTP ${response.status}) on ${path}: ${body.substring(0, 300)}` ); } return response.json(); }
- src/client.ts:43-54 (helper)sanitiseError() function - sanitizes error messages by redacting auth tokens and passwords, and truncates long responsesfunction sanitiseError(err: unknown, context: string): string { const raw = err instanceof Error ? err.message : String(err); // Remove anything that looks like a token or password value let sanitised = raw .replace(/auth_token[=:]\s*\S+/gi, "auth_token=[REDACTED]") .replace(/password[=:]\s*\S+/gi, "password=[REDACTED]"); // Truncate excessively long API response bodies if (sanitised.length > 500) { sanitised = sanitised.substring(0, 500) + "... (truncated)"; } return `${context}: ${sanitised}`; }