Skip to main content
Glama
badchars

osint-mcp-server

by badchars

crtsh_search

Search Certificate Transparency logs to discover subdomains and analyze SSL/TLS certificates for domain reconnaissance and attack surface mapping.

Instructions

Search Certificate Transparency logs via crt.sh. Returns unique subdomains and certificate details (issuer, validity, SANs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to search CT logs for
exclude_expiredNoExclude expired certificates (default: false)

Implementation Reference

  • The core implementation of the crtsh_search tool. It queries crt.sh, processes the JSON response, deduplicates subdomains, handles expiration filtering, and caches results.
    export async function crtshSearch(domain: string, excludeExpired = false): Promise<CrtshResult> {
      const cacheKey = `${domain}:${excludeExpired}`;
      const cached = cache.get(cacheKey);
      if (cached) return cached;
    
      await limiter.acquire();
    
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 30000);
    
      try {
        const url = `https://crt.sh/?q=%25.${encodeURIComponent(domain)}&output=json`;
        const res = await fetch(url, { signal: controller.signal });
        if (!res.ok) throw new Error(`crt.sh returned ${res.status}`);
    
        const data: any[] = await res.json();
        const now = Date.now();
    
        // Deduplicate subdomains
        const subdomainSet = new Set<string>();
        const certificates: CrtshCert[] = [];
    
        for (const entry of data) {
          const nameValue: string = entry.name_value ?? "";
          const notAfter = entry.not_after ? new Date(entry.not_after).getTime() : Infinity;
    
          if (excludeExpired && notAfter < now) continue;
    
          // name_value can contain multiple domains separated by \n
          const names = nameValue.split("\n").map((n: string) => n.trim().toLowerCase()).filter(Boolean);
          for (const name of names) {
            if (!name.startsWith("*")) subdomainSet.add(name);
            else subdomainSet.add(name); // Keep wildcards too
          }
    
          certificates.push({
            issuer: entry.issuer_name ?? "",
            commonName: entry.common_name ?? "",
            nameValue,
            notBefore: entry.not_before ?? "",
            notAfter: entry.not_after ?? "",
            id: entry.id ?? 0,
          });
        }
    
        // Sort subdomains and limit certificates shown
        const uniqueSubdomains = [...subdomainSet].sort();
    
        const result: CrtshResult = {
          domain,
          totalCerts: data.length,
          uniqueSubdomains,
          certificates: certificates.slice(0, 50), // Limit to avoid huge responses
        };
    
        cache.set(cacheKey, result);
        return result;
      } finally {
        clearTimeout(timeout);
      }
    }
  • Registration of the crtsh_search tool including its schema definition and invocation of the handler.
    const crtshSearchTool: ToolDef = {
      name: "crtsh_search",
      description: "Search Certificate Transparency logs via crt.sh. Returns unique subdomains and certificate details (issuer, validity, SANs).",
      schema: {
        domain: z.string().describe("Domain to search CT logs for"),
        exclude_expired: z.boolean().optional().describe("Exclude expired certificates (default: false)"),
      },
      execute: async (args) =>
        json(await crtshSearch(args.domain as string, args.exclude_expired as boolean | undefined)),
    };
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what data is returned, not behavioral aspects like rate limits, authentication requirements, pagination, or error conditions. It doesn't mention whether this is a read-only operation or has any side effects.

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 core purpose and key return values without any wasted words. Every element serves a clear informational purpose.

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

Completeness3/5

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

For a 2-parameter tool with no annotations and no output schema, the description adequately covers the basic purpose and return data types but lacks important context about behavioral characteristics, error handling, and comparison to sibling tools that would help an agent use it effectively.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter-specific context beyond what's in the schema, maintaining the baseline score for high schema coverage.

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 specific action ('Search Certificate Transparency logs via crt.sh') and resource ('unique subdomains and certificate details'), distinguishing it from sibling tools like 'vt_subdomains' or 'st_subdomains' by specifying the CT log source and certificate-level data.

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?

No guidance is provided on when to use this tool versus alternatives like 'censys_certificates' or 'vt_subdomains'. The description mentions what it returns but doesn't indicate scenarios where CT log searching is preferred over other subdomain discovery methods.

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/badchars/osint-mcp-server'

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