Patent Dataset Statistics
patent_statsGet patent dataset statistics: total count, type breakdown, top CPC sections, top assignees, last update time, and data source information.
Instructions
Get statistics about the patent dataset: total patents, type breakdown, top CPC sections, top assignees, last updated timestamp, and data source information. Free endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/patents.ts:153-185 (handler)The handler for the 'patent_stats' tool. It registers the tool with MCP, takes no input parameters, calls the API endpoint /api/v1/patents/stats, and returns the statistics as JSON.
// ── Dataset stats ─────────────────────────────────────────────────────── server.registerTool( "patent_stats", { title: "Patent Dataset Statistics", description: "Get statistics about the patent dataset: total patents, type breakdown, " + "top CPC sections, top assignees, last updated timestamp, and data source information. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<PatentStatsResponse>("/api/v1/patents/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/patents.ts:21-26 (schema)TypeScript interface PatentStatsResponse defining the shape of the API response (dataset, source, update_frequency, stats).
interface PatentStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/patents.ts:155-163 (registration)Registration of the 'patent_stats' tool via server.registerTool with title, description, and empty inputSchema.
server.registerTool( "patent_stats", { title: "Patent Dataset Statistics", description: "Get statistics about the patent dataset: total patents, type breakdown, " + "top CPC sections, top assignees, last updated timestamp, and data source information. Free endpoint.", inputSchema: {}, }, - src/tools/patents.ts:6-6 (helper)Comment line documenting the patent_stats tool purpose at the top of the file.
// patent_stats — Get patent dataset statistics