Skip to main content
Glama
RMITBLOG

Parallels RAS MCP Server

by RMITBLOG

Certificates

ras_infra_get_certificates
Read-onlyIdempotent

List and audit SSL/TLS certificates in a Parallels RAS farm to check expiration dates, verify assignments, and monitor certificate inventory.

Instructions

List the certificate inventory for the RAS farm, including certificate names, expiration dates, issuers, and usage. Use this to audit SSL/TLS certificates, check for upcoming expirations, or verify certificate assignments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration and handler implementation for ras_infra_get_certificates. This read-only tool fetches certificate inventory from the RAS API endpoint /api/infrastructure/certificates and returns the data as formatted JSON.
    server.registerTool(
      "ras_infra_get_certificates",
      {
        title: "Certificates",
        description:
          "List the certificate inventory for the RAS farm, including certificate names, " +
          "expiration dates, issuers, and usage. Use this to audit SSL/TLS certificates, " +
          "check for upcoming expirations, or verify certificate assignments.",
        annotations: READ_ONLY_ANNOTATIONS,
        inputSchema: {},
      },
      async () => {
        try {
          const data = await rasClient.get("/api/infrastructure/certificates");
          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 certificates") }], isError: true };
        }
      }
    );
  • The actual handler function that executes the tool logic. It makes an authenticated GET request to /api/infrastructure/certificates, formats the response as JSON, and handles errors with sanitization.
    async () => {
      try {
        const data = await rasClient.get("/api/infrastructure/certificates");
        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 certificates") }], isError: true };
      }
    }
  • The rasClient.get method that performs authenticated API requests to the RAS backend. It handles login, auth token management, retries on 401 errors, and request timeouts.
    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 utility function that removes sensitive information (auth tokens, passwords) from error messages and truncates excessively long responses to prevent information leakage.
    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}`;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, open-world, idempotent, and non-destructive behavior, so the description doesn't need to repeat these. However, it adds context by specifying the inventory includes details like expiration dates and usage, which helps the agent understand the scope and potential use cases, though it doesn't mention rate limits or auth needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by specific use cases. Every sentence adds value without redundancy, making it efficient and easy to parse for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema) and rich annotations, the description is complete enough for a list operation. It explains what data is returned and usage scenarios, though it doesn't detail output format or pagination, which could be minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't discuss parameters, which is appropriate, but it could have noted the lack of parameters for clarity. Baseline is 3, but the tool's simplicity and full schema coverage justify a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('List') and resource ('certificate inventory for the RAS farm'), including details like certificate names, expiration dates, issuers, and usage. It distinguishes from sibling tools by focusing on certificates, unlike other tools that handle administrators, licensing, performance, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides usage scenarios: 'audit SSL/TLS certificates, check for upcoming expirations, or verify certificate assignments.' This gives clear guidance on when to use this tool, such as for monitoring or compliance purposes, without needing to reference alternatives since it's a specialized list operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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