Skip to main content
Glama
badchars

osint-mcp-server

by badchars

shodan_dns_resolve

Resolve hostnames to IP addresses using Shodan's DNS resolver for reconnaissance and attack surface mapping.

Instructions

Resolve hostnames to IPs using Shodan's DNS resolver. Requires SHODAN_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostnamesYesHostnames to resolve

Implementation Reference

  • The handler function that executes the Shodan DNS resolution.
    export async function shodanDnsResolve(hostnames: string[], apiKey: string): Promise<Record<string, string | null>> {
      await limiter.acquire();
      const csv = hostnames.join(",");
      const res = await fetch(`https://api.shodan.io/dns/resolve?hostnames=${encodeURIComponent(csv)}&key=${apiKey}`);
      if (!res.ok) throw new Error(`Shodan DNS resolve failed: ${res.status}`);
      return res.json();
    }
  • Tool definition and registration for 'shodan_dns_resolve'.
    const shodanDnsResolveTool: ToolDef = {
      name: "shodan_dns_resolve",
      description: "Resolve hostnames to IPs using Shodan's DNS resolver. Requires SHODAN_API_KEY.",
      schema: {
        hostnames: z.array(z.string()).describe("Hostnames to resolve"),
      },
      execute: async (args, ctx) => {
        const key = requireApiKey(ctx.config.shodanApiKey, "Shodan", "SHODAN_API_KEY");
        return json(await shodanDnsResolve(args.hostnames as string[], key));
      },
    };
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 API key requirement, which is a useful authentication detail. However, it lacks other critical behavioral traits: it does not describe the return format (e.g., whether it returns a list of IPs, error handling), rate limits, or any constraints (e.g., batch size limits for hostnames). For a tool with no annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is concise and front-loaded, consisting of two sentences that directly state the tool's function and key requirement. There is no wasted language or redundancy. However, it could be slightly more structured by explicitly separating purpose from prerequisites, but this is a minor issue that does not detract significantly from its efficiency.

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 complexity of a DNS resolution tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects (e.g., response format, error cases) and does not leverage the context of sibling tools to guide usage. While it covers the basic purpose and authentication, it falls short in providing a comprehensive understanding needed for effective tool invocation in a diverse toolset.

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 'hostnames' parameter documented as 'Hostnames to resolve'. The description does not add any additional semantic meaning beyond this, such as format examples or constraints. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema adequately handles parameter documentation without needing extra detail from the description.

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 tool's purpose: 'Resolve hostnames to IPs using Shodan's DNS resolver.' It specifies the verb ('Resolve'), resource ('hostnames'), and method ('using Shodan's DNS resolver'), making the function unambiguous. However, it does not explicitly differentiate from sibling DNS tools like 'dns_lookup' or 'dns_reverse', which slightly limits its clarity in a crowded toolset.

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 minimal usage guidance: it mentions the requirement for 'SHODAN_API_KEY', which is a prerequisite but not a contextual guideline. It does not indicate when to use this tool versus alternatives (e.g., other DNS tools in the sibling list), nor does it specify scenarios or exclusions. This lack of comparative context leaves the agent without clear direction on tool selection.

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