Skip to main content
Glama

batch_lookup

Retrieve geolocation and network data for multiple IP addresses simultaneously using IPInfo's API to analyze IP intelligence in bulk operations.

Instructions

Batch lookup multiple IP addresses.

Args: ips: List of IP addresses to lookup (can include field paths like "8.8.8.8/city")

Returns: Dictionary with IP information for each address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipsYes

Implementation Reference

  • The primary handler function for the 'batch_lookup' MCP tool. It is registered via the @mcp.tool() decorator and implements the tool logic by invoking the IPInfoClient's batch method.
    @mcp.tool() async def batch_lookup(ips: list[str], ctx: Context[Any, Any, Any]) -> dict[str, Any]: """Batch lookup multiple IP addresses. Args: ips: List of IP addresses to lookup (can include field paths like "8.8.8.8/city") Returns: Dictionary with IP information for each address. """ client = get_client(ctx) try: return await client.batch(ips) except IPInfoAPIError as e: ctx.error(f"API error: {e.message}") raise
  • The supporting helper method in IPInfoClient that performs the actual batch API request to ipinfo.io/batch endpoint, called by the tool handler.
    async def batch(self, ips: list[str]) -> dict[str, Any]: """Batch lookup multiple IP addresses.""" data = await self._request("POST", "/batch", json_data=ips) return data

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