ras_farm_get_mailbox
Retrieve SMTP mailbox configuration for Parallels RAS email notifications to verify settings or troubleshoot delivery issues.
Instructions
Get the SMTP mailbox configuration used for RAS email notifications, including server address, port, and sender details. Use this to verify email notification settings or troubleshoot notification delivery failures.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/farm-settings.ts:131-150 (handler)Tool handler for ras_farm_get_mailbox that fetches SMTP mailbox configuration from the RAS API at /api/farm-settings/mailbox endpoint and returns the data as formatted JSON with error handling.server.registerTool( "ras_farm_get_mailbox", { title: "Mailbox Settings", description: "Get the SMTP mailbox configuration used for RAS email notifications, " + "including server address, port, and sender details. Use this to verify " + "email notification settings or troubleshoot notification delivery failures.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {}, }, async () => { try { const data = await rasClient.get("/api/farm-settings/mailbox"); 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 mailbox settings") }], isError: true }; } } );
- src/tools/farm-settings.ts:131-150 (registration)Tool registration for ras_farm_get_mailbox with metadata including title, description, read-only annotations, and empty input schema (no parameters required).server.registerTool( "ras_farm_get_mailbox", { title: "Mailbox Settings", description: "Get the SMTP mailbox configuration used for RAS email notifications, " + "including server address, port, and sender details. Use this to verify " + "email notification settings or troubleshoot notification delivery failures.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {}, }, async () => { try { const data = await rasClient.get("/api/farm-settings/mailbox"); 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 mailbox settings") }], isError: true }; } } );
- src/client.ts:128-166 (helper)The rasClient.get() helper method that handles authentication, token management, automatic retry on 401, request timeouts, and makes GET requests to the RAS API endpoints.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 that removes sensitive information (auth tokens, passwords) from error messages and truncates excessively 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}`; }
- src/index.ts:14-28 (registration)Module-level registration where the farm-settings module (containing ras_farm_get_mailbox) is imported and registered with the MCP server instance.import { register as registerFarmSettings } from "./tools/farm-settings.js"; import { register as registerPublishing } from "./tools/publishing.js"; import { register as registerRdSessions } from "./tools/rd-sessions.js"; import { register as registerHelpSupport } from "./tools/help-support.js"; const server = new McpServer({ name: "parallels-ras", version: "1.0.0", }); // Register all tool modules registerInfrastructure(server); registerSiteSettings(server); registerPolicies(server); registerFarmSettings(server);