shieldapi.check_ip
Check IP reputation by analyzing blacklists, detecting Tor exit nodes, and performing reverse DNS lookups to assess security risks.
Instructions
Check IP reputation: blacklists, Tor exit node detection, reverse DNS.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | IPv4 address to check (e.g. 8.8.8.8) |
Implementation Reference
- src/index.ts:179-187 (registration)The tool 'shieldapi.check_ip' is registered dynamically within this loop, utilizing the 'TOOLS' definition map and calling the 'callShieldApi' helper function.
for (const [name, def] of Object.entries(TOOLS)) { server.tool( name, def.description, { [def.param]: z.string().describe(def.paramDesc) }, { ...readOnlyAnnotations, title: TOOL_TITLES[name] || name }, async (params) => formatResult(await callShieldApi(def.endpoint, params as Record<string, string>)) ); } - src/index.ts:101-116 (handler)This is the generic handler function that executes the API call for 'shieldapi.check_ip' (and other GET tools) by appending the endpoint and query parameters to the SHIELDAPI_URL.
async function callShieldApi(endpoint: string, params: Record<string, string>): Promise<unknown> { const url = new URL(`${SHIELDAPI_URL}/api/${endpoint}`); for (const [key, value] of Object.entries(params)) { url.searchParams.set(key, value); } if (demoMode) { url.searchParams.set('demo', 'true'); } const response = await paymentFetch(url.toString()); if (!response.ok) { const body = await response.text(); throw new Error(`ShieldAPI ${endpoint} failed (${response.status}): ${body.substring(0, 200)}`); } return response.json(); }