Skip to main content
Glama
NimbleBrainInc

IPInfo MCP Server

get_ip_ranges

Retrieve IP address ranges associated with a specific domain or organization to identify their network infrastructure and IP blocks.

Instructions

Get IP ranges owned by a domain/organization.

Args: domain: Domain name to lookup

Returns: IP ranges information including IPv4 and IPv6 blocks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Implementation Reference

  • The main handler function for the 'get_ip_ranges' tool. It is decorated with @mcp.tool() for automatic registration and MCP integration. Calls IPInfoClient.get_ranges(domain) to fetch the IP ranges.
    @mcp.tool()
    async def get_ip_ranges(domain: str, ctx: Context[Any, Any, Any]) -> RangesResponse:
        """Get IP ranges owned by a domain/organization.
    
        Args:
            domain: Domain name to lookup
    
        Returns:
            IP ranges information including IPv4 and IPv6 blocks.
        """
        client = get_client(ctx)
        try:
            return await client.get_ranges(domain)
        except IPInfoAPIError as e:
            ctx.error(f"API error: {e.message}")
            raise
  • Pydantic model defining the output response schema (RangesResponse) used by the get_ip_ranges tool.
    class RangesResponse(BaseModel):
        domain: str = Field(..., description="Domain name")
        num_ranges: str = Field(..., description="Number of ranges")
        redirects_to: str = Field(..., description="Redirects to domain")
        ranges: list[str] = Field(..., description="List of IP ranges")
  • The @mcp.tool() decorator registers the get_ip_ranges function as an MCP tool.
    @mcp.tool()

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/NimbleBrainInc/mcp-ipinfo'

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