Label Dataset Statistics
label_statsGet statistics for the address label dataset: total labeled addresses, categories covered, last updated timestamp. Free endpoint.
Instructions
Get statistics about the address label dataset: total labeled addresses, categories covered, last updated timestamp. Free endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/labels.ts:123-153 (handler)The actual tool handler for 'label_stats'. Calls apiGet to /api/v1/labels/stats and returns the stats as JSON text content.
server.registerTool( "label_stats", { title: "Label Dataset Statistics", description: "Get statistics about the address label dataset: total labeled addresses, " + "categories covered, last updated timestamp. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<LabelStatsResponse>("/api/v1/labels/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/labels.ts:20-25 (schema)TypeScript interface LabelStatsResponse defining the shape of the API response (dataset, source, update_frequency, stats).
interface LabelStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/labels.ts:123-153 (schema)The inputSchema for 'label_stats' is an empty object (zod validation), meaning no parameters required.
server.registerTool( "label_stats", { title: "Label Dataset Statistics", description: "Get statistics about the address label dataset: total labeled addresses, " + "categories covered, last updated timestamp. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<LabelStatsResponse>("/api/v1/labels/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/labels.ts:123-131 (registration)Registration of 'label_stats' tool via server.registerTool with title, description, empty inputSchema.
server.registerTool( "label_stats", { title: "Label Dataset Statistics", description: "Get statistics about the address label dataset: total labeled addresses, " + "categories covered, last updated timestamp. Free endpoint.", inputSchema: {}, }, - src/index.ts:23-23 (registration)Import of registerLabelTools from ./tools/labels.js in the main entry point.
import { registerLabelTools } from "./tools/labels.js"; - src/index.ts:50-50 (registration)Invocation of registerLabelTools(server) which registers all label tools including 'label_stats'.
registerLabelTools(server);