Sanctions Dataset Statistics
sanctions_statsRetrieve statistics on sanctions dataset including total entries, lists covered, last update timestamp, and data source. Free endpoint.
Instructions
Get statistics about the sanctions dataset: total entries, lists covered, last updated timestamp, and data source information. Free endpoint.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "sanctions_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/sanctions.ts:202-223 (handler)Handler function for sanctions_stats tool. Makes a GET request to /api/v1/sanctions/stats and returns the JSON response as text.
async () => { const res = await apiGet<SanctionsStatsResponse>("/api/v1/sanctions/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/sanctions.ts:21-26 (schema)TypeScript interface defining the response shape for the sanctions stats endpoint.
interface SanctionsStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/sanctions.ts:193-223 (registration)Registration of the sanctions_stats tool on the MCP server with name, description, and empty input schema.
server.registerTool( "sanctions_stats", { title: "Sanctions Dataset Statistics", description: "Get statistics about the sanctions dataset: total entries, lists covered, " + "last updated timestamp, and data source information. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<SanctionsStatsResponse>("/api/v1/sanctions/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/index.ts:48-48 (registration)Call that registers all sanctions tools (including sanctions_stats) on the MCP server.
registerSanctionsTools(server); - src/client.ts:44-76 (helper)HTTP client helper used by the sanctions_stats handler to make the GET request to 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, }; }