Skip to main content
Glama
RMITBLOG

Parallels RAS MCP Server

by RMITBLOG

ras_pub_get_folders

List published resource folders to review application and desktop organization, check hierarchy, and verify folder-level access settings in Parallels RAS.

Instructions

List published resource folders that organise applications and desktops into logical groups for end users. Use this to review the folder hierarchy, check resource organisation, or verify folder-level access settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The ras_pub_get_folders tool registration and handler implementation. The tool is registered with server.registerTool() and the handler makes an async GET request to '/api/publishing/folders' endpoint using rasClient, returns the JSON data as text content, and handles errors with sanitiseError.
    server.registerTool( "ras_pub_get_folders", { title: "Publishing Folders", description: "List published resource folders that organise applications and desktops " + "into logical groups for end users. Use this to review the folder hierarchy, " + "check resource organisation, or verify folder-level access settings.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {}, }, async () => { try { const data = await rasClient.get("/api/publishing/folders"); 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 publishing folders") }], isError: true }; } } );
  • The RasClient.get() method used by ras_pub_get_folders to make authenticated GET requests to the RAS API. Handles lazy authentication, automatic retry on 401 errors, request timeouts, and returns parsed JSON responses.
    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(); }
  • The sanitiseError() function used by ras_pub_get_folders handler to sanitize error messages by removing sensitive data like auth tokens and passwords, and truncating excessively long API 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}`; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RMITBLOG/ParallelsRAS_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server