Skip to main content
Glama
badchars

osint-mcp-server

by badchars

shodan_exploits

Search Shodan's exploit database for public exploits matching a query, such as a CVE ID or keyword. Filter results by exploit type.

Instructions

Search Shodan's exploit database for public exploits matching a query. Requires SHODAN_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesExploit search query (e.g. 'apache 2.4' or CVE ID)
typeNoFilter by exploit type (e.g. 'exploit', 'metasploit')

Implementation Reference

  • Core handler function: calls Shodan exploit search API (https://exploits.shodan.io/api/search) with query, apiKey, and optional type filter. Returns total count and matching exploits (title, source, type, author, date, CVE).
    export async function shodanExploits(query: string, apiKey: string, type?: string): Promise<ShodanExploitResult> {
      await limiter.acquire();
      const params = new URLSearchParams({ query, key: apiKey });
      if (type) params.set("type", type);
    
      const res = await fetch(`https://exploits.shodan.io/api/search?${params}`);
      if (!res.ok) throw new Error(`Shodan exploit search failed: ${res.status}`);
      const data = await res.json();
    
      return {
        total: data.total ?? 0,
        matches: (data.matches ?? []).map((m: any) => ({
          title: m.description ?? m.title ?? "",
          source: m.source ?? "",
          type: m.type,
          author: m.author,
          date: m.date,
          cve: m.cve,
        })),
      };
    }
  • Type definition for the Shodan exploit search result: total count and matches array with title, source, type, author, date, and CVE fields.
    interface ShodanExploitResult {
      total: number;
      matches: { title: string; source: string; type?: string; author?: string; date?: string; cve?: string[] }[];
    }
  • Zod schema for shodan_exploits tool: requires 'query' (string) and optional 'type' (string) filter.
    schema: {
      query: z.string().describe("Exploit search query (e.g. 'apache 2.4' or CVE ID)"),
      type: z.string().optional().describe("Filter by exploit type (e.g. 'exploit', 'metasploit')"),
    },
  • ToolDef registration for shodan_exploits: defines name, description, schema, and execute handler that calls shodanExploits().
    const shodanExploitsTool: ToolDef = {
      name: "shodan_exploits",
      description: "Search Shodan's exploit database for public exploits matching a query. Requires SHODAN_API_KEY.",
      schema: {
        query: z.string().describe("Exploit search query (e.g. 'apache 2.4' or CVE ID)"),
        type: z.string().optional().describe("Filter by exploit type (e.g. 'exploit', 'metasploit')"),
      },
      execute: async (args, ctx) => {
        const key = requireApiKey(ctx.config.shodanApiKey, "Shodan", "SHODAN_API_KEY");
        return json(await shodanExploits(args.query as string, key, args.type as string | undefined));
      },
    };
  • shodanExploitsTool is included in the exported tools array at line 498.
    shodanExploitsTool,
Behavior2/5

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

With no annotations, the description is the sole source of behavioral info. It only reveals the API key requirement but omits other traits like rate limits, read-only nature, error handling, or result 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?

The description is extremely concise—two short sentences that convey the essential purpose and a prerequisite. Every word earns its place.

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 lack of output schema, the description should compensate by hinting at the return format or behaviors, but it does not. For a simple search tool, it misses contextual details like pagination or result structure.

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%, and the description does not add meaning beyond the schema for the 'query' and 'type' parameters. The baseline of 3 is appropriate as no extra value is provided.

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 'Search Shodan's exploit database for public exploits matching a query,' with a specific verb and resource. It uniquely identifies the tool's function among siblings like shodan_search.

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 mentions the API key requirement but provides no guidance on when to use this tool versus alternatives or when not to use it. It lacks exclusions or context for 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