Skip to main content
Glama
firesh

SSL Monitor MCP Server

by firesh

Get domain info

get_domain_info

Retrieve domain registration details including expiration date and remaining validity period through WHOIS/RDAP lookup for security monitoring.

Instructions

Get domain registration, expiration, and daysUntilExpiry using WHOIS/RDAP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesThe top-level domain to check (e.g., sslmon.dev)

Implementation Reference

  • Core handler function implementing the tool logic: queries RDAP for domain info, falls back to WHOIS parsing, and returns formatted JSON response.
    private async getDomainInfo(domain: string): Promise<any> {
      try {
        // First try RDAP protocol
        const rdapInfo = await this.queryRDAP(domain);
        if (rdapInfo) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(rdapInfo, null, 2),
              },
            ],
          };
        }
      } catch (rdapError) {
        console.error(`RDAP query failed for ${domain}:`, rdapError);
      }
    
      try {
        // Fallback to whois protocol
        const whoisInfo = await this.queryWhois(domain);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(whoisInfo, null, 2),
            },
          ],
        };
      } catch (whoisError) {
        return {
          content: [
            {
              type: "text",
              text: `Domain info lookup failed for ${domain}: ${whoisError instanceof Error ? whoisError.message : String(whoisError)}`,
            },
          ],
        };
      }
    }
  • src/index.ts:57-75 (registration)
    Tool registration including input schema validation and thin error-handling wrapper that delegates to getDomainInfo method.
      "get_domain_info",
      {
        title: "Get domain info",
        description: "Get domain registration, expiration, and daysUntilExpiry using WHOIS/RDAP.",
        inputSchema: {
          domain: z.string().describe("The top-level domain to check (e.g., sslmon.dev)"),
        },
      },
      async ({ domain }) => {
        try {
          return await this.getDomainInfo(domain);
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true,
          };
        }
      }
    );
  • TypeScript interface defining the structure of domain information output used by the handler.
    interface DomainInfo {
      domain: string;
      registrationDate?: string;
      expirationDate?: string;
      registrar?: string;
      registrant?: string;
      status?: string;
      daysUntilExpiry?: number;
    }
  • Helper function to query the appropriate RDAP server for domain registration information.
    async queryRDAP(domain: string): Promise<DomainInfo | null> {
      const tld = domain.split('.').pop()?.toLowerCase();
      if (!tld) {
        throw new Error('Invalid domain format');
      }
    
      // Get RDAP bootstrap data to find the right RDAP server
      let rdapServer = await this.getRDAPServer(tld);
      if (!rdapServer) {
        return null;
      }
      if (!rdapServer.endsWith('/')) {
        rdapServer = rdapServer+'/';
      }
    
      const url = `${rdapServer}domain/${domain}`;
      console.log(`Querying RDAP server: ${url}`);
      const response = await this.httpRequest(url);
      const data = JSON.parse(response);
    
      return this.parseRDAPData(data, domain);
    }
  • Fallback helper function to query WHOIS server for domain information.
    async queryWhois(domain: string): Promise<DomainInfo> {
      const tld = domain.split('.').pop()?.toLowerCase();
      if (!tld) {
        throw new Error('Invalid domain format');
      }
    
      // Get whois server for the TLD
      const whoisServer = await this.getWhoisServer(tld);
      if (!whoisServer) {
        throw new Error(`No whois server found for TLD: ${tld}`);
      }
    
      const whoisData = await this.performWhoisQuery(domain, whoisServer);
      return this.parseWhoisData(whoisData, domain);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the data sources (WHOIS/RDAP) but fails to describe critical behaviors such as rate limits, authentication requirements, error handling, or response format. For a read operation with external dependencies, this lack of detail is a significant gap.

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 a single, efficient sentence that front-loads the key information (what data is retrieved and how). There is no wasted verbiage or redundancy, making it highly concise and well-structured for quick comprehension.

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

Completeness2/5

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

Given the tool's complexity (involving external WHOIS/RDAP lookups) and the absence of both annotations and an output schema, the description is insufficient. It does not explain the return values, error conditions, or operational constraints, leaving the agent under-informed about how to interpret results or handle failures.

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

Parameters3/5

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

The input schema has 100% description coverage, with the single parameter 'domain' clearly documented in the schema. The description does not add any additional meaning or examples beyond what the schema provides (e.g., it doesn't elaborate on domain format or validation). Thus, it meets the baseline of 3 where the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Get') and the specific information retrieved ('domain registration, expiration, and daysUntilExpiry'), along with the method ('using WHOIS/RDAP'). It distinguishes from the sibling tool 'get_ssl_cert_info' by focusing on domain metadata rather than SSL certificates. However, it doesn't explicitly contrast with the sibling, so it falls short of a perfect 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like the sibling 'get_ssl_cert_info', nor does it mention any prerequisites or exclusions. It simply states what the tool does without contextual usage advice, leaving the agent to infer based on tool names alone.

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/firesh/sslmon-mcp'

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