OTC Dataset Statistics
otc_statsRetrieve key statistics for the OTC company dataset, including total companies, companies with financials, average shell risk score, and update timestamp.
Instructions
Get statistics about the OTC company dataset: total companies, companies with financials, average shell risk score, 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": "otc_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/otc.ts:156-186 (handler)The `otc_stats` tool handler registered with MCP server. Calls the Verilex API endpoint /api/v1/otc/stats and returns dataset statistics (company count, last updated, etc.). No input parameters required.
server.registerTool( "otc_stats", { title: "OTC Dataset Statistics", description: "Get statistics about the OTC company dataset: total companies, companies with financials, " + "average shell risk score, last updated timestamp, and data source information. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<OtcStatsResponse>("/api/v1/otc/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/otc.ts:21-26 (schema)TypeScript interface `OtcStatsResponse` defining the expected response shape: dataset name, source, update_frequency, and stats object.
interface OtcStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/index.ts:43-43 (registration)Registration call: `registerOtcTools(server)` is invoked from the main index.ts to register all OTC tools including otc_stats.
registerOtcTools(server); - src/client.ts:44-76 (helper)The `apiGet` helper used by all tools (including otc_stats) to make HTTP GET requests to the Verilex API backend.
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, }; }