list_search_facets
Discover available search facets to refine Shodan queries, enhancing device and network analysis for cybersecurity research and threat intelligence.
Instructions
List all available search facets that can be used with Shodan queries
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1546-1564 (handler)MCP tool handler implementation for 'list_search_facets' that calls the ShodanClient's listSearchFacets method, formats the result as JSON text content, and handles errors.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:362-377 (helper)Helper method in ShodanClient class that makes an API request to Shodan's /shodan/host/search/facets endpoint to retrieve the list of available search facets.* List all available search facets */ 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:1025-1032 (registration)Registration of the 'list_search_facets' tool in the ListToolsRequestSchema handler's response array, including name, description, and input schema (empty object).{ name: "list_search_facets", description: "List all available search facets that can be used with Shodan queries", inputSchema: { type: "object", properties: {} } },
- src/index.ts:1028-1031 (schema)Input schema definition for the 'list_search_facets' tool, specifying an empty object (no parameters required).inputSchema: { type: "object", properties: {} }