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
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |
Implementation Reference
- src/mcp_ipinfo/server.py:255-270 (handler)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
- src/mcp_ipinfo/api_models.py:102-107 (schema)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")
- src/mcp_ipinfo/server.py:255-255 (registration)The @mcp.tool() decorator registers the get_ip_ranges function as an MCP tool.@mcp.tool()