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();
    }
Behavior2/5

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

No annotations provided, so the description carries full burden. It discloses the precondition (API key) and output fields, but lacks behavioral traits such as safety (read-only), rate limits, pagination, or any potential side effects. With no annotations, this is insufficient for an agent to fully understand behavior.

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?

Two sentences, front-loaded with purpose, followed by output details and prerequisite. Every piece of information adds value with no redundancy. Excellent conciseness.

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 no output schema, the description explains return fields (dates, values, organizations). However, it omits details like pagination, maximum results, or handling of no data. For a simple two-parameter tool, it covers most needs but has minor gaps.

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?

Both parameters are fully documented in the input schema with descriptions and enum values. The description does not add additional semantics beyond stating what the output contains, which does not enhance parameter understanding. Baseline 3 is appropriate.

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?

Description clearly states verb 'Get', resource 'historical DNS records', and specifies the source 'via SecurityTrails'. It also lists what is shown: first/last seen dates, values, organizations. This distinguishes it from sibling DNS tools like dns_lookup that provide current records.

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 usage for historical DNS records but does not explicitly state when to use this tool versus alternatives like dns_lookup. The prerequisite 'Requires ST_API_KEY' hints at a specific data source but lacks explicit guidance on scenarios or exclusions.

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