list_search_facets
Discover available search filters to refine Shodan queries for cybersecurity research and threat intelligence.
Instructions
List all available search facets that can be used with Shodan queries
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1546-1564 (handler)MCP server tool handler for 'list_search_facets' that calls ShodanClient.listSearchFacets() and returns the JSON-formatted facets list.
case "list_search_facets": { try { const facets = await shodanClient.listSearchFacets(); return { content: [{ type: "text", text: JSON.stringify(facets, null, 2) }] }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `Error listing search facets: ${(error as Error).message}` ); } } - src/index.ts:364-377 (helper)ShodanClient method that performs the actual API call to retrieve available search facets from Shodan.
async listSearchFacets(): Promise<any> { try { const response = await this.axiosInstance.get("/shodan/host/search/facets"); return { facets: response.data }; } catch (error: unknown) { if (axios.isAxiosError(error)) { throw new McpError( ErrorCode.InternalError, `Shodan API error: ${error.response?.data?.error || error.message}` ); } throw error; } } - src/index.ts:1026-1032 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and empty input schema.
name: "list_search_facets", description: "List all available search facets that can be used with Shodan queries", inputSchema: { type: "object", properties: {} } }, - src/index.ts:1029-1032 (schema)Input schema for the 'list_search_facets' tool (empty object, no parameters required).
type: "object", properties: {} } },