ras_infra_get_gateway_status
Check the status of Secure Client Gateways to monitor health and troubleshoot external connectivity issues for published resources.
Instructions
Get the status of RAS Secure Client Gateways, including connection state, IP addresses, and tunnel mode. Gateways provide external user access to published resources. Use this to monitor gateway health or troubleshoot external connectivity issues.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/infrastructure.ts:253-260 (handler)The handler function that executes the ras_infra_get_gateway_status tool logic. It calls the RAS API endpoint '/api/infrastructure/gateway/status' and returns the gateway status data as JSON, with error handling using sanitiseError.async () => { try { const data = await rasClient.get("/api/infrastructure/gateway/status"); 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 gateway status") }], isError: true }; } }
- src/tools/infrastructure.ts:241-261 (registration)Full registration of the ras_infra_get_gateway_status tool, including its metadata (title, description, annotations, inputSchema) and the handler function implementation.server.registerTool( "ras_infra_get_gateway_status", { title: "Gateway Status", description: "Get the status of RAS Secure Client Gateways, including connection state, " + "IP addresses, and tunnel mode. Gateways provide external user access to " + "published resources. Use this to monitor gateway health or troubleshoot " + "external connectivity issues.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {}, }, async () => { try { const data = await rasClient.get("/api/infrastructure/gateway/status"); 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 gateway status") }], isError: true }; } } );
- src/tools/infrastructure.ts:243-251 (schema)Schema definition for the ras_infra_get_gateway_status tool, including title, description, read-only annotations, and empty input schema (no parameters required).{ title: "Gateway Status", description: "Get the status of RAS Secure Client Gateways, including connection state, " + "IP addresses, and tunnel mode. Gateways provide external user access to " + "published resources. Use this to monitor gateway health or troubleshoot " + "external connectivity issues.", annotations: READ_ONLY_ANNOTATIONS, inputSchema: {},
- src/tools/infrastructure.ts:12-17 (helper)READ_ONLY_ANNOTATIONS constant used by the ras_infra_get_gateway_status tool to mark it as read-only, non-destructive, idempotent, and open-world.const READ_ONLY_ANNOTATIONS = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, } as const;
- src/client.ts:128-166 (helper)The rasClient.get() method used by the handler to make authenticated GET requests to the RAS API endpoint. Handles authentication, retries on 401, 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(); }