Whale Dataset Statistics
whale_statsRetrieve statistics on the whale wallet dataset, including total wallets tracked, chains covered, and last update timestamp. Free endpoint.
Instructions
Get statistics about the whale wallet dataset: total wallets tracked, chains covered, last updated timestamp. Free endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/whales.ts:272-293 (handler)Handler for whale_stats tool. Calls GET /api/v1/whales/stats and returns the stats JSON.
async () => { const res = await apiGet<WhaleStatsResponse>("/api/v1/whales/stats"); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(res.data, null, 2) }, ], }; }, ); - src/tools/whales.ts:22-27 (schema)TypeScript interface defining the shape of the API response for whale_stats (dataset, source, update_frequency, stats).
interface WhaleStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/whales.ts:263-293 (registration)Registration of whale_stats tool via server.registerTool with its metadata and handler.
server.registerTool( "whale_stats", { title: "Whale Dataset Statistics", description: "Get statistics about the whale wallet dataset: total wallets tracked, " + "chains covered, last updated timestamp. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<WhaleStatsResponse>("/api/v1/whales/stats"); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(res.data, null, 2) }, ], }; }, ); - src/client.ts:10-23 (helper)Helper function that constructs full URLs from path and optional query params (used by apiGet).
function buildUrl( path: string, params?: Record<string, string | number | undefined>, ): string { const url = new URL(path, baseUrl); if (params) { for (const [k, v] of Object.entries(params)) { if (v !== undefined && v !== "") { url.searchParams.set(k, String(v)); } } } return url.toString(); } - src/client.ts:44-76 (helper)HTTP GET client used by the handler to call the Verilex API.
export async function apiGet<T = unknown>( path: string, params?: Record<string, string | number | undefined>, ): Promise<ApiResponse<T>> { const url = buildUrl(path, params); const headers: Record<string, string> = { Accept: "application/json", "User-Agent": "verilex-mcp-server/0.1.0", }; // Forward x402 payment token if present in env (for paid endpoints) const paymentToken = process.env.VERILEX_PAYMENT_TOKEN; if (paymentToken) { headers["X-Payment-Token"] = paymentToken; } const res = await fetch(url, { headers }); const data = (await res.json()) as T; const stale = res.headers.get("X-Data-Stale"); const lastUpdated = res.headers.get("X-Data-Last-Updated"); const ageSeconds = res.headers.get("X-Data-Age-Seconds"); return { ok: res.ok, status: res.status, data, stale: stale === "true", lastUpdated: lastUpdated ?? undefined, ageSeconds: ageSeconds ? Number(ageSeconds) : undefined, }; }