ras_infra_get_vdi_hostpools
Retrieve VDI host pool configurations to review composition, check provisioning status, and verify pool sizing in Parallels RAS infrastructure.
Instructions
List VDI host pool configuration, including pool members, provisioning settings, and capacity. Use this to review VDI pool composition, check desktop provisioning status, or verify pool sizing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/infrastructure.ts:208-215 (handler)The main handler function that executes the ras_infra_get_vdi_hostpools tool logic. It makes an API GET request to /api/infrastructure/vdi/host-pool and returns the JSON data or an error message.async () => { try { const data = await rasClient.get("/api/infrastructure/vdi/host-pool"); 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 VDI host pools") }], isError: true }; } }
- src/tools/infrastructure.ts:197-216 (registration)Registration of the ras_infra_get_vdi_hostpools tool with the MCP server, including its title, description, read-only annotations, and empty input schema.server.registerTool( "ras_infra_get_vdi_hostpools", { title: "VDI Host Pools", description: "List VDI host pool configuration, including pool members, provisioning settings, " + "and capacity. Use this to review VDI pool composition, check desktop provisioning " + "status, or verify pool sizing.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {}, }, async () => { try { const data = await rasClient.get("/api/infrastructure/vdi/host-pool"); 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 VDI host pools") }], isError: true }; } } );
- src/tools/infrastructure.ts:206-206 (schema)The input schema definition for ras_infra_get_vdi_hostpools - an empty object indicating the tool takes no input parameters.inputSchema: {},
- src/client.ts:128-166 (helper)The RasClient.get() helper method used by the handler to make authenticated GET requests to the RAS API, including automatic authentication, 401 retry logic, and error handling.async 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)The sanitiseError helper function used by the handler to sanitize error messages by redacting auth tokens and passwords and truncating long responses.function 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}`; }