Skip to main content
Glama
Cyreslab-AI

Shodan MCP Server

get_my_ip

Retrieve your current public IP address to identify your network's external presence for cybersecurity analysis and Shodan API integration.

Instructions

Get your current IP address as seen from the Internet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_my_ip' that invokes shodanClient.getMyIp() and formats the response as JSON text.
    case "get_my_ip": {
      try {
        const myIp = await shodanClient.getMyIp();
        return {
          content: [{
            type: "text",
            text: JSON.stringify(myIp, null, 2)
          }]
        };
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Error getting IP address: ${(error as Error).message}`
        );
      }
    }
  • src/index.ts:1079-1086 (registration)
    Tool registration in ListToolsRequestSchema handler, including name, description, and empty input schema.
    {
      name: "get_my_ip",
      description: "Get your current IP address as seen from the Internet",
      inputSchema: {
        type: "object",
        properties: {}
      }
    },
  • ShodanClient helper method that queries the Shodan API endpoint '/tools/myip' to retrieve the current IP address.
    async getMyIp(): Promise<any> {
      try {
        const response = await this.axiosInstance.get("/tools/myip");
        return { ip: 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;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states what the tool does but lacks behavioral details like whether it makes external requests, has rate limits, requires authentication, or what format the IP address is returned in (e.g., IPv4, IPv6). This is a significant gap for a tool that likely involves network interaction.

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 a single, clear sentence that is front-loaded with the core purpose. There is no wasted language, and every word earns its place by specifying the action and scope efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is adequate but incomplete. It explains what the tool does but lacks details on behavior (e.g., network calls, response format) that would be helpful for an agent. With no annotations and no output schema, more context on the return value would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, but it does clarify the scope ('as seen from the Internet'), which is useful context. Baseline is 4 for zero parameters.

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 the verb 'Get' and the resource 'your current IP address', specifying it's 'as seen from the Internet'. This distinguishes it from sibling tools like 'get_host_info' or 'get_domain_info' which retrieve different types of network information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. While the purpose is clear, there's no mention of when this tool is appropriate compared to other network-related tools in the sibling list, such as 'get_host_info' or 'reverse_dns_lookup'.

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

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