Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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}` ); } }
  • 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: {} } },
  • Input schema definition for the 'list_search_facets' tool, specifying an empty object (no parameters required).
    inputSchema: { type: "object", properties: {} }

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/Cyreslab-AI/shodan-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server