Skip to main content
Glama
badchars

osint-mcp-server

by badchars

st_dns_history

Retrieve historical DNS records for a domain, including first and last seen dates, values, and organizations. Specify record type (A, AAAA, MX, NS, SOA, TXT).

Instructions

Get historical DNS records for a domain via SecurityTrails. Shows first/last seen dates, values, and organizations. Requires ST_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to get DNS history for
typeYesDNS record type

Implementation Reference

  • The main handler function for st_dns_history. Calls SecurityTrails API at /history/{domain}/dns/{type}, parses records with first/last seen dates, values, and organizations.
    export async function stDnsHistory(domain: string, type: string, apiKey: string): Promise<StDnsHistoryResult> {
      const validTypes = ["a", "aaaa", "mx", "ns", "soa", "txt"];
      const t = type.toLowerCase();
      if (!validTypes.includes(t)) throw new Error(`Invalid DNS type: ${type}. Valid: ${validTypes.join(", ")}`);
    
      const data = await stFetch(`/history/${encodeURIComponent(domain)}/dns/${t}`, apiKey);
      const records: StDnsHistoryRecord[] = (data.records ?? []).map((r: any) => ({
        values: (r.values ?? []).map((v: any) => v.ip ?? v.host ?? v.value ?? String(v)),
        type: r.type ?? t,
        firstSeen: r.first_seen ?? "",
        lastSeen: r.last_seen ?? "",
        organizations: r.organizations,
      }));
    
      return { domain, type: t, records, total: records.length };
    }
  • Type definitions for DNS history records and result structure.
    interface StDnsHistoryRecord {
      values: string[];
      type: string;
      firstSeen: string;
      lastSeen: string;
      organizations?: string[];
    }
    
    interface StDnsHistoryResult {
      domain: string;
      type: string;
      records: StDnsHistoryRecord[];
      total: number;
    }
  • Tool registration definition for st_dns_history. Registers the tool with name, description, Zod schema (domain + type enum), and execute handler that calls stDnsHistory.
    const stDnsHistoryTool: ToolDef = {
      name: "st_dns_history",
      description: "Get historical DNS records for a domain via SecurityTrails. Shows first/last seen dates, values, and organizations. Requires ST_API_KEY.",
      schema: {
        domain: z.string().describe("Domain to get DNS history for"),
        type: z.enum(["a", "aaaa", "mx", "ns", "soa", "txt"]).describe("DNS record type"),
      },
      execute: async (args, ctx) => {
        const key = requireApiKey(ctx.config.stApiKey, "SecurityTrails", "ST_API_KEY");
        return json(await stDnsHistory(args.domain as string, args.type as string, key));
      },
    };
  • src/index.ts:38-38 (registration)
    Tool listing in the main index, showing st_dns_history as a SecurityTrails tool requiring ST_API_KEY.
    { label: "SecurityTrails", env: "ST_API_KEY", tools: ["st_subdomains", "st_dns_history", "st_whois"] },
  • Helper function stFetch used by stDnsHistory to make authenticated HTTP requests to the SecurityTrails API with rate limiting.
    async function stFetch(path: string, apiKey: string): Promise<any> {
      await limiter.acquire();
      const res = await fetch(`${ST_BASE}${path}`, {
        headers: { APIKEY: apiKey, Accept: "application/json" },
      });
      if (!res.ok) throw new Error(`SecurityTrails API error: ${res.status} ${res.statusText}`);
      return res.json();
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It discloses that the tool fetches historical records and shows first/last seen dates, values, and organizations, indicating a read operation. However, it omits details on pagination, rate limits, and potential errors.

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 two sentences, front-loading the primary action and data source. No extraneous words; every clause adds value (purpose, data source, key output fields, prerequisite).

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?

Given the tool's complexity (2 parameters, no output schema, no annotations), the description covers purpose and basic output but lacks details on output format, limits, and error handling. It is adequate but not comprehensive.

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 coverage is 100%, so parameters are already described. The tool description adds context about output fields ('first/last seen dates, values, organizations'), which indirectly clarifies parameter use but does not add significant new meaning beyond the schema.

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 specifies 'Get historical DNS records for a domain via SecurityTrails', clearly stating the action and resource. It distinguishes from sibling tools like dns_lookup (current records) by focusing on historical data and mentioning SecurityTrails.

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

Usage Guidelines3/5

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

The description implies use for historical DNS analysis but does not explicitly state when to use this tool versus alternatives like dns_lookup or other SecurityTrails tools. No exclusions or comparative guidance are provided.

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