list_protocols
Discover available protocols for conducting Internet scans to identify devices and services for cybersecurity analysis and threat intelligence gathering.
Instructions
List all protocols that can be used when performing on-demand Internet scans
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1634-1652 (handler)The main handler for the 'list_protocols' tool within the CallToolRequestSchema switch statement. It invokes the ShodanClient's listProtocols method and returns the formatted JSON response.case "list_protocols": { try { const protocols = await shodanClient.listProtocols(); return { content: [{ type: "text", text: JSON.stringify(protocols, null, 2) }] }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `Error listing protocols: ${(error as Error).message}` ); } }
- src/index.ts:1064-1070 (schema)Schema definition and registration of the 'list_protocols' tool in the ListToolsRequestSchema handler response. It defines the tool name, description, and empty input schema (no parameters required).name: "list_protocols", description: "List all protocols that can be used when performing on-demand Internet scans", inputSchema: { type: "object", properties: {} } },
- src/index.ts:438-451 (helper)Helper method in the ShodanClient class that performs the actual API call to Shodan's /shodan/protocols endpoint to retrieve the list of available protocols.async listProtocols(): Promise<any> { try { const response = await this.axiosInstance.get("/shodan/protocols"); return { protocols: 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; } }