patents-mcp-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +191 -0
  3. package/dist/base.client-zZnUjoIb.js +2 -0
  4. package/dist/base.client-zZnUjoIb.js.map +1 -0
  5. package/dist/clients/base.client.d.ts +19 -0
  6. package/dist/clients/base.client.js +1 -0
  7. package/dist/clients/bigquery.client.d.ts +14 -0
  8. package/dist/clients/bigquery.client.js +66 -0
  9. package/dist/clients/bigquery.client.js.map +1 -0
  10. package/dist/clients/epo-ops.client.d.ts +13 -0
  11. package/dist/clients/epo-ops.client.js +2 -0
  12. package/dist/clients/epo-ops.client.js.map +1 -0
  13. package/dist/clients/odp.client.d.ts +52 -0
  14. package/dist/clients/odp.client.js +2 -0
  15. package/dist/clients/odp.client.js.map +1 -0
  16. package/dist/clients/patentsview.client.d.ts +38 -0
  17. package/dist/clients/patentsview.client.js +2 -0
  18. package/dist/clients/patentsview.client.js.map +1 -0
  19. package/dist/generated/odp/index.d.ts +2 -0
  20. package/dist/generated/odp/index.js +1 -0
  21. package/dist/generated/odp/types.gen.d.ts +4432 -0
  22. package/dist/generated/odp/types.gen.js +1 -0
  23. package/dist/generated/odp/zod.gen.d.ts +7504 -0
  24. package/dist/generated/odp/zod.gen.js +2 -0
  25. package/dist/generated/odp/zod.gen.js.map +1 -0
  26. package/dist/generated/patentsview/index.d.ts +2 -0
  27. package/dist/generated/patentsview/index.js +1 -0
  28. package/dist/generated/patentsview/types.gen.d.ts +2454 -0
  29. package/dist/generated/patentsview/types.gen.js +1 -0
  30. package/dist/generated/patentsview/zod.gen.d.ts +3376 -0
  31. package/dist/generated/patentsview/zod.gen.js +2 -0
  32. package/dist/generated/patentsview/zod.gen.js.map +1 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +3 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/lib/config.d.ts +24 -0
  37. package/dist/lib/config.js +2 -0
  38. package/dist/lib/config.js.map +1 -0
  39. package/dist/lib/errors.d.ts +7 -0
  40. package/dist/lib/errors.js +2 -0
  41. package/dist/lib/errors.js.map +1 -0
  42. package/dist/lib/patent-number.d.ts +5 -0
  43. package/dist/lib/patent-number.js +2 -0
  44. package/dist/lib/patent-number.js.map +1 -0
  45. package/dist/lib/retry.d.ts +10 -0
  46. package/dist/lib/retry.js +2 -0
  47. package/dist/lib/retry.js.map +1 -0
  48. package/dist/lib/types.d.ts +22 -0
  49. package/dist/lib/types.js +1 -0
  50. package/dist/prompts/index.d.ts +7 -0
  51. package/dist/prompts/index.js +255 -0
  52. package/dist/prompts/index.js.map +1 -0
  53. package/dist/resources/index.d.ts +7 -0
  54. package/dist/resources/index.js +44 -0
  55. package/dist/resources/index.js.map +1 -0
  56. package/dist/server.d.ts +8 -0
  57. package/dist/server.js +2 -0
  58. package/dist/server.js.map +1 -0
  59. package/dist/tools/bigquery.tools.d.ts +7 -0
  60. package/dist/tools/bigquery.tools.js +14 -0
  61. package/dist/tools/bigquery.tools.js.map +1 -0
  62. package/dist/tools/citations.tools.d.ts +7 -0
  63. package/dist/tools/citations.tools.js +2 -0
  64. package/dist/tools/citations.tools.js.map +1 -0
  65. package/dist/tools/epo.tools.d.ts +7 -0
  66. package/dist/tools/epo.tools.js +18 -0
  67. package/dist/tools/epo.tools.js.map +1 -0
  68. package/dist/tools/index.d.ts +7 -0
  69. package/dist/tools/index.js +2 -0
  70. package/dist/tools/index.js.map +1 -0
  71. package/dist/tools/odp.tools.d.ts +7 -0
  72. package/dist/tools/odp.tools.js +2 -0
  73. package/dist/tools/odp.tools.js.map +1 -0
  74. package/dist/tools/office-actions.tools.d.ts +7 -0
  75. package/dist/tools/office-actions.tools.js +2 -0
  76. package/dist/tools/office-actions.tools.js.map +1 -0
  77. package/dist/tools/patentsview.tools.d.ts +7 -0
  78. package/dist/tools/patentsview.tools.js +2 -0
  79. package/dist/tools/patentsview.tools.js.map +1 -0
  80. package/dist/tools/ptab.tools.d.ts +7 -0
  81. package/dist/tools/ptab.tools.js +2 -0
  82. package/dist/tools/ptab.tools.js.map +1 -0
  83. package/dist/tools/utility.tools.d.ts +7 -0
  84. package/dist/tools/utility.tools.js +2 -0
  85. package/dist/tools/utility.tools.js.map +1 -0
  86. package/package.json +67 -0
@@ -0,0 +1,7 @@
1
+ import { FastMCP } from "fastmcp";
2
+
3
+ //#region src/tools/office-actions.tools.d.ts
4
+ declare const registerOfficeActionsTools: (server: FastMCP) => void;
5
+ //#endregion
6
+ export { registerOfficeActionsTools };
7
+ //# sourceMappingURL=office-actions.tools.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{config as e}from"../lib/config.js";import{handleApiError as t}from"../lib/errors.js";import"../base.client-zZnUjoIb.js";import{OdpClient as n}from"../clients/odp.client.js";import{z as r}from"zod";const i={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},a=()=>new n({apiKey:e.usptoApiKey??(()=>{throw Error(`USPTO_API_KEY is required`)})(),timeout:e.requestTimeout}),o=e=>{e.addTool({name:`office-action-get-text`,description:`Get the full text of office actions for a patent application. Includes examiner rejections, objections, and requirements.`,parameters:r.object({applicationNumber:r.string().describe(`Application number (e.g., 16/123,456 or 16123456)`)}),annotations:i,execute:async e=>{try{let t=await a().getOfficeActionText(e.applicationNumber);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`office-action-search`,description:`Search office actions across USPTO patent applications.`,parameters:r.object({query:r.string().describe(`Search query text`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchOfficeActions(e.query,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`office-action-get-citations`,description:`Get prior art citations from office actions for a patent application. Shows references cited by the examiner.`,parameters:r.object({applicationNumber:r.string().describe(`Application number (e.g., 16/123,456 or 16123456)`)}),annotations:i,execute:async e=>{try{let t=await a().getOfficeActionCitations(e.applicationNumber);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`office-action-get-rejections`,description:`Get rejection data from office actions for a patent application. Includes rejection types (35 USC 101, 102, 103, 112) and affected claims.`,parameters:r.object({applicationNumber:r.string().describe(`Application number (e.g., 16/123,456 or 16123456)`)}),annotations:i,execute:async e=>{try{let t=await a().getOfficeActionRejections(e.applicationNumber);return JSON.stringify(t)}catch(e){return t(e)}}})};export{o as registerOfficeActionsTools};
2
+ //# sourceMappingURL=office-actions.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"office-actions.tools.js","names":[],"sources":["../../src/tools/office-actions.tools.ts"],"sourcesContent":["import type { FastMCP } from \"fastmcp\"\nimport { z } from \"zod\"\n\nimport { OdpClient } from \"../clients/odp.client\"\nimport { config } from \"../lib/config\"\nimport { handleApiError } from \"../lib/errors\"\n\nconst OA_ANNOTATIONS = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n} as const\n\nconst createClient = (): OdpClient => {\n return new OdpClient({\n apiKey:\n config.usptoApiKey ??\n (() => {\n throw new Error(\"USPTO_API_KEY is required\")\n })(),\n timeout: config.requestTimeout,\n })\n}\n\nexport const registerOfficeActionsTools = (server: FastMCP): void => {\n server.addTool({\n name: \"office-action-get-text\",\n description:\n \"Get the full text of office actions for a patent application. Includes examiner rejections, objections, and requirements.\",\n parameters: z.object({\n applicationNumber: z.string().describe(\"Application number (e.g., 16/123,456 or 16123456)\"),\n }),\n annotations: OA_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getOfficeActionText(args.applicationNumber)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"office-action-search\",\n description: \"Search office actions across USPTO patent applications.\",\n parameters: z.object({\n query: z.string().describe(\"Search query text\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: OA_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchOfficeActions(args.query, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"office-action-get-citations\",\n description:\n \"Get prior art citations from office actions for a patent application. Shows references cited by the examiner.\",\n parameters: z.object({\n applicationNumber: z.string().describe(\"Application number (e.g., 16/123,456 or 16123456)\"),\n }),\n annotations: OA_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getOfficeActionCitations(args.applicationNumber)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"office-action-get-rejections\",\n description:\n \"Get rejection data from office actions for a patent application. Includes rejection types (35 USC 101, 102, 103, 112) and affected claims.\",\n parameters: z.object({\n applicationNumber: z.string().describe(\"Application number (e.g., 16/123,456 or 16123456)\"),\n }),\n annotations: OA_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getOfficeActionRejections(args.applicationNumber)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n}\n"],"mappings":"4MAOA,MAAM,EAAiB,CACrB,aAAc,GACd,gBAAiB,GACjB,eAAgB,GAChB,cAAe,GAChB,CAEK,MACG,IAAI,EAAU,CACnB,OACE,EAAO,kBACA,CACL,MAAU,MAAM,4BAA4B,IAC1C,CACN,QAAS,EAAO,eACjB,CAAC,CAGS,EAA8B,GAA0B,CACnE,EAAO,QAAQ,CACb,KAAM,yBACN,YACE,4HACF,WAAY,EAAE,OAAO,CACnB,kBAAmB,EAAE,QAAQ,CAAC,SAAS,oDAAoD,CAC5F,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,oBAAoB,EAAK,kBAAkB,CACvE,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,uBACN,YAAa,0DACb,WAAY,EAAE,OAAO,CACnB,MAAO,EAAE,QAAQ,CAAC,SAAS,oBAAoB,CAC/C,MAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,sCAAsC,CACpG,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,oBAAoB,EAAK,MAAO,EAAK,MAAM,CACvE,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,8BACN,YACE,gHACF,WAAY,EAAE,OAAO,CACnB,kBAAmB,EAAE,QAAQ,CAAC,SAAS,oDAAoD,CAC5F,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,yBAAyB,EAAK,kBAAkB,CAC5E,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,+BACN,YACE,6IACF,WAAY,EAAE,OAAO,CACnB,kBAAmB,EAAE,QAAQ,CAAC,SAAS,oDAAoD,CAC5F,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,0BAA0B,EAAK,kBAAkB,CAC7E,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { FastMCP } from "fastmcp";
2
+
3
+ //#region src/tools/patentsview.tools.d.ts
4
+ declare const registerPatentsViewTools: (server: FastMCP) => void;
5
+ //#endregion
6
+ export { registerPatentsViewTools };
7
+ //# sourceMappingURL=patentsview.tools.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{config as e}from"../lib/config.js";import{handleApiError as t}from"../lib/errors.js";import"../base.client-zZnUjoIb.js";import{PatentsViewClient as n}from"../clients/patentsview.client.js";import{z as r}from"zod";const i={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},a=()=>new n({apiKey:e.patentsViewApiKey,timeout:e.requestTimeout}),o=e=>{e.addTool({name:`patentsview-search-patents`,description:`Search for patents on PatentsView by text query, assignee name, or inventor name. Returns patent metadata including title, abstract, date, assignees, and inventors.`,parameters:r.object({query:r.string().describe(`Search query string (text, assignee name, or inventor name)`),search_type:r.enum([`text`,`assignee`,`inventor`]).default(`text`).describe(`Type of search: text (abstract search), assignee (organization), or inventor (name)`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchPatents(e.query,e.search_type,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-get-patent`,description:`Get detailed information about a specific patent by its patent ID (e.g., '11234567'). Returns full patent metadata.`,parameters:r.object({patent_id:r.string().describe(`The patent ID (e.g., '11234567')`)}),annotations:i,execute:async e=>{try{let t=await a().getPatent(e.patent_id);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-search-assignees`,description:`Search for patent assignees (organizations or individuals) by name. Returns assignee details and patent counts.`,parameters:r.object({name:r.string().describe(`Assignee name or organization to search for`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchAssignees(e.name,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-get-assignee`,description:`Get detailed information about a specific patent assignee by their assignee ID.`,parameters:r.object({assignee_id:r.string().describe(`The assignee ID`)}),annotations:i,execute:async e=>{try{let t=await a().getAssignee(e.assignee_id);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-search-inventors`,description:`Search for patent inventors by name. Returns inventor details and patent counts.`,parameters:r.object({name:r.string().describe(`Inventor name to search for`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchInventors(e.name,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-get-inventor`,description:`Get detailed information about a specific patent inventor by their inventor ID.`,parameters:r.object({inventor_id:r.string().describe(`The inventor ID`)}),annotations:i,execute:async e=>{try{let t=await a().getInventor(e.inventor_id);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-search-attorneys`,description:`Search for patent attorneys/agents by name or organization. Returns attorney details and patent counts.`,parameters:r.object({name:r.string().describe(`Attorney name or organization to search for`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchAttorneys(e.name,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-get-attorney`,description:`Get detailed information about a specific patent attorney by their attorney ID.`,parameters:r.object({attorney_id:r.string().describe(`The attorney ID`)}),annotations:i,execute:async e=>{try{let t=await a().getAttorney(e.attorney_id);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-get-claims`,description:`Get the claims text for a specific patent by its patent ID.`,parameters:r.object({patent_id:r.string().describe(`The patent ID to get claims for`)}),annotations:i,execute:async e=>{try{let t=await a().getClaims(e.patent_id);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-get-description`,description:`Get the description text for a specific patent by its patent ID. Includes brief summary, detailed description, and drawing descriptions.`,parameters:r.object({patent_id:r.string().describe(`The patent ID to get description for`)}),annotations:i,execute:async e=>{try{let t=await a().getDescription(e.patent_id);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-search-by-cpc`,description:`Search for patents by CPC (Cooperative Patent Classification) code. CPC codes classify patents by technology area.`,parameters:r.object({cpc_code:r.string().describe(`CPC subgroup code (e.g., 'A61K31/00' for medicinal preparations)`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchByCpc(e.cpc_code,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-lookup-cpc`,description:`Look up a CPC (Cooperative Patent Classification) subgroup code to get its title and classification details.`,parameters:r.object({cpc_code:r.string().describe(`CPC subgroup code to look up (e.g., 'A61K31/00')`)}),annotations:i,execute:async e=>{try{let t=await a().lookupCpc(e.cpc_code);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-search-by-ipc`,description:`Search for patents by IPC (International Patent Classification) code. IPC codes classify patents internationally.`,parameters:r.object({ipc_code:r.string().describe(`IPC class code (e.g., 'A61K')`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchByIpc(e.ipc_code,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`patentsview-lookup-ipc`,description:`Look up an IPC (International Patent Classification) code to get its classification details.`,parameters:r.object({ipc_code:r.string().describe(`IPC class code to look up (e.g., 'A61K')`)}),annotations:i,execute:async e=>{try{let t=await a().lookupIpc(e.ipc_code);return JSON.stringify(t)}catch(e){return t(e)}}})};export{o as registerPatentsViewTools};
2
+ //# sourceMappingURL=patentsview.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patentsview.tools.js","names":[],"sources":["../../src/tools/patentsview.tools.ts"],"sourcesContent":["import type { FastMCP } from \"fastmcp\"\nimport { z } from \"zod\"\n\nimport { PatentsViewClient } from \"../clients/patentsview.client\"\nimport { config } from \"../lib/config\"\nimport { handleApiError } from \"../lib/errors\"\n\nconst TOOL_ANNOTATIONS = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n} as const\n\nconst createClient = (): PatentsViewClient => {\n return new PatentsViewClient({\n apiKey: config.patentsViewApiKey,\n timeout: config.requestTimeout,\n })\n}\n\nexport const registerPatentsViewTools = (server: FastMCP): void => {\n server.addTool({\n name: \"patentsview-search-patents\",\n description:\n \"Search for patents on PatentsView by text query, assignee name, or inventor name. Returns patent metadata including title, abstract, date, assignees, and inventors.\",\n parameters: z.object({\n query: z.string().describe(\"Search query string (text, assignee name, or inventor name)\"),\n search_type: z\n .enum([\"text\", \"assignee\", \"inventor\"])\n .default(\"text\")\n .describe(\"Type of search: text (abstract search), assignee (organization), or inventor (name)\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchPatents(args.query, args.search_type, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-get-patent\",\n description:\n \"Get detailed information about a specific patent by its patent ID (e.g., '11234567'). Returns full patent metadata.\",\n parameters: z.object({\n patent_id: z.string().describe(\"The patent ID (e.g., '11234567')\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getPatent(args.patent_id)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-search-assignees\",\n description:\n \"Search for patent assignees (organizations or individuals) by name. Returns assignee details and patent counts.\",\n parameters: z.object({\n name: z.string().describe(\"Assignee name or organization to search for\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchAssignees(args.name, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-get-assignee\",\n description: \"Get detailed information about a specific patent assignee by their assignee ID.\",\n parameters: z.object({\n assignee_id: z.string().describe(\"The assignee ID\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getAssignee(args.assignee_id)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-search-inventors\",\n description: \"Search for patent inventors by name. Returns inventor details and patent counts.\",\n parameters: z.object({\n name: z.string().describe(\"Inventor name to search for\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchInventors(args.name, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-get-inventor\",\n description: \"Get detailed information about a specific patent inventor by their inventor ID.\",\n parameters: z.object({\n inventor_id: z.string().describe(\"The inventor ID\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getInventor(args.inventor_id)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-search-attorneys\",\n description:\n \"Search for patent attorneys/agents by name or organization. Returns attorney details and patent counts.\",\n parameters: z.object({\n name: z.string().describe(\"Attorney name or organization to search for\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchAttorneys(args.name, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-get-attorney\",\n description: \"Get detailed information about a specific patent attorney by their attorney ID.\",\n parameters: z.object({\n attorney_id: z.string().describe(\"The attorney ID\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getAttorney(args.attorney_id)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-get-claims\",\n description: \"Get the claims text for a specific patent by its patent ID.\",\n parameters: z.object({\n patent_id: z.string().describe(\"The patent ID to get claims for\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getClaims(args.patent_id)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-get-description\",\n description:\n \"Get the description text for a specific patent by its patent ID. Includes brief summary, detailed description, and drawing descriptions.\",\n parameters: z.object({\n patent_id: z.string().describe(\"The patent ID to get description for\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getDescription(args.patent_id)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-search-by-cpc\",\n description:\n \"Search for patents by CPC (Cooperative Patent Classification) code. CPC codes classify patents by technology area.\",\n parameters: z.object({\n cpc_code: z.string().describe(\"CPC subgroup code (e.g., 'A61K31/00' for medicinal preparations)\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchByCpc(args.cpc_code, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-lookup-cpc\",\n description:\n \"Look up a CPC (Cooperative Patent Classification) subgroup code to get its title and classification details.\",\n parameters: z.object({\n cpc_code: z.string().describe(\"CPC subgroup code to look up (e.g., 'A61K31/00')\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.lookupCpc(args.cpc_code)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-search-by-ipc\",\n description:\n \"Search for patents by IPC (International Patent Classification) code. IPC codes classify patents internationally.\",\n parameters: z.object({\n ipc_code: z.string().describe(\"IPC class code (e.g., 'A61K')\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchByIpc(args.ipc_code, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"patentsview-lookup-ipc\",\n description: \"Look up an IPC (International Patent Classification) code to get its classification details.\",\n parameters: z.object({\n ipc_code: z.string().describe(\"IPC class code to look up (e.g., 'A61K')\"),\n }),\n annotations: TOOL_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.lookupIpc(args.ipc_code)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n}\n"],"mappings":"4NAOA,MAAM,EAAmB,CACvB,aAAc,GACd,gBAAiB,GACjB,eAAgB,GAChB,cAAe,GAChB,CAEK,MACG,IAAI,EAAkB,CAC3B,OAAQ,EAAO,kBACf,QAAS,EAAO,eACjB,CAAC,CAGS,EAA4B,GAA0B,CACjE,EAAO,QAAQ,CACb,KAAM,6BACN,YACE,uKACF,WAAY,EAAE,OAAO,CACnB,MAAO,EAAE,QAAQ,CAAC,SAAS,8DAA8D,CACzF,YAAa,EACV,KAAK,CAAC,OAAQ,WAAY,WAAW,CAAC,CACtC,QAAQ,OAAO,CACf,SAAS,sFAAsF,CAClG,MAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,sCAAsC,CACpG,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,cAAc,EAAK,MAAO,EAAK,YAAa,EAAK,MAAM,CACnF,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAA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AEF,IAAM,EAAS,MADA,GAAc,CACD,UAAU,EAAK,SAAS,CACpD,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,4BACN,YACE,oHACF,WAAY,EAAE,OAAO,CACnB,SAAU,EAAE,QAAQ,CAAC,SAAS,gCAAgC,CAC9D,MAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,sCAAsC,CACpG,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,YAAY,EAAK,SAAU,EAAK,MAAM,CAClE,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,yBACN,YAAa,+FACb,WAAY,EAAE,OAAO,CACnB,SAAU,EAAE,QAAQ,CAAC,SAAS,2CAA2C,CAC1E,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,UAAU,EAAK,SAAS,CACpD,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { FastMCP } from "fastmcp";
2
+
3
+ //#region src/tools/ptab.tools.d.ts
4
+ declare const registerPtabTools: (server: FastMCP) => void;
5
+ //#endregion
6
+ export { registerPtabTools };
7
+ //# sourceMappingURL=ptab.tools.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{config as e}from"../lib/config.js";import{handleApiError as t}from"../lib/errors.js";import"../base.client-zZnUjoIb.js";import{OdpClient as n}from"../clients/odp.client.js";import{z as r}from"zod";const i={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},a=()=>new n({apiKey:e.usptoApiKey??(()=>{throw Error(`USPTO_API_KEY is required`)})(),timeout:e.requestTimeout}),o=e=>{e.addTool({name:`ptab-search-proceedings`,description:`Search PTAB (Patent Trial and Appeal Board) proceedings including IPR, PGR, and CBM trials. Returns trial metadata, parties, and status.`,parameters:r.object({query:r.string().describe(`Search query text`),type:r.enum([`IPR`,`PGR`,`CBM`]).optional().describe(`Proceeding type filter`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchProceedings(e.query,e.type,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`ptab-get-proceeding`,description:`Get detailed information about a specific PTAB proceeding by trial number.`,parameters:r.object({trialNumber:r.string().describe(`PTAB trial number (e.g., IPR2020-01234)`)}),annotations:i,execute:async e=>{try{let t=await a().getProceeding(e.trialNumber);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`ptab-get-documents`,description:`Get documents filed in a PTAB proceeding.`,parameters:r.object({trialNumber:r.string().describe(`PTAB trial number (e.g., IPR2020-01234)`)}),annotations:i,execute:async e=>{try{let t=await a().getProceedingDocuments(e.trialNumber);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`ptab-search-decisions`,description:`Search PTAB decisions across all proceeding types.`,parameters:r.object({query:r.string().describe(`Search query text`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchDecisions(e.query,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`ptab-get-decision`,description:`Get a specific PTAB decision by ID.`,parameters:r.object({decisionId:r.string().describe(`Decision identifier`)}),annotations:i,execute:async e=>{try{let t=await a().getDecision(e.decisionId);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`ptab-search-appeals`,description:`Search ex parte appeals to the PTAB.`,parameters:r.object({query:r.string().describe(`Search query text`),limit:r.number().int().min(1).max(100).default(25).describe(`Number of results to return (1-100)`)}),annotations:i,execute:async e=>{try{let t=await a().searchAppeals(e.query,e.limit);return JSON.stringify(t)}catch(e){return t(e)}}}),e.addTool({name:`ptab-get-appeal`,description:`Get details about a specific ex parte appeal.`,parameters:r.object({appealId:r.string().describe(`Appeal identifier`)}),annotations:i,execute:async e=>{try{let t=await a().getAppeal(e.appealId);return JSON.stringify(t)}catch(e){return t(e)}}})};export{o as registerPtabTools};
2
+ //# sourceMappingURL=ptab.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ptab.tools.js","names":[],"sources":["../../src/tools/ptab.tools.ts"],"sourcesContent":["import type { FastMCP } from \"fastmcp\"\nimport { z } from \"zod\"\n\nimport { OdpClient } from \"../clients/odp.client\"\nimport { config } from \"../lib/config\"\nimport { handleApiError } from \"../lib/errors\"\n\nconst PTAB_ANNOTATIONS = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n} as const\n\nconst createClient = (): OdpClient => {\n return new OdpClient({\n apiKey:\n config.usptoApiKey ??\n (() => {\n throw new Error(\"USPTO_API_KEY is required\")\n })(),\n timeout: config.requestTimeout,\n })\n}\n\nexport const registerPtabTools = (server: FastMCP): void => {\n server.addTool({\n name: \"ptab-search-proceedings\",\n description:\n \"Search PTAB (Patent Trial and Appeal Board) proceedings including IPR, PGR, and CBM trials. Returns trial metadata, parties, and status.\",\n parameters: z.object({\n query: z.string().describe(\"Search query text\"),\n type: z.enum([\"IPR\", \"PGR\", \"CBM\"]).optional().describe(\"Proceeding type filter\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchProceedings(args.query, args.type, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"ptab-get-proceeding\",\n description: \"Get detailed information about a specific PTAB proceeding by trial number.\",\n parameters: z.object({\n trialNumber: z.string().describe(\"PTAB trial number (e.g., IPR2020-01234)\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getProceeding(args.trialNumber)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"ptab-get-documents\",\n description: \"Get documents filed in a PTAB proceeding.\",\n parameters: z.object({\n trialNumber: z.string().describe(\"PTAB trial number (e.g., IPR2020-01234)\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getProceedingDocuments(args.trialNumber)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"ptab-search-decisions\",\n description: \"Search PTAB decisions across all proceeding types.\",\n parameters: z.object({\n query: z.string().describe(\"Search query text\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchDecisions(args.query, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"ptab-get-decision\",\n description: \"Get a specific PTAB decision by ID.\",\n parameters: z.object({\n decisionId: z.string().describe(\"Decision identifier\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getDecision(args.decisionId)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"ptab-search-appeals\",\n description: \"Search ex parte appeals to the PTAB.\",\n parameters: z.object({\n query: z.string().describe(\"Search query text\"),\n limit: z.number().int().min(1).max(100).default(25).describe(\"Number of results to return (1-100)\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.searchAppeals(args.query, args.limit)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"ptab-get-appeal\",\n description: \"Get details about a specific ex parte appeal.\",\n parameters: z.object({\n appealId: z.string().describe(\"Appeal identifier\"),\n }),\n annotations: PTAB_ANNOTATIONS,\n execute: async (args) => {\n try {\n const client = createClient()\n const result = await client.getAppeal(args.appealId)\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n}\n"],"mappings":"4MAOA,MAAM,EAAmB,CACvB,aAAc,GACd,gBAAiB,GACjB,eAAgB,GAChB,cAAe,GAChB,CAEK,MACG,IAAI,EAAU,CACnB,OACE,EAAO,kBACA,CACL,MAAU,MAAM,4BAA4B,IAC1C,CACN,QAAS,EAAO,eACjB,CAAC,CAGS,EAAqB,GAA0B,CAC1D,EAAO,QAAQ,CACb,KAAM,0BACN,YACE,2IACF,WAAY,EAAE,OAAO,CACnB,MAAO,EAAE,QAAQ,CAAC,SAAS,oBAAoB,CAC/C,KAAM,EAAE,KAAK,CAAC,MAAO,MAAO,MAAM,CAAC,CAAC,UAAU,CAAC,SAAS,yBAAyB,CACjF,MAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,sCAAsC,CACpG,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,kBAAkB,EAAK,MAAO,EAAK,KAAM,EAAK,MAAM,CAChF,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,sBACN,YAAa,6EACb,WAAY,EAAE,OAAO,CACnB,YAAa,EAAE,QAAQ,CAAC,SAAS,0CAA0C,CAC5E,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,cAAc,EAAK,YAAY,CAC3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AAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,sCAAsC,CACpG,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,cAAc,EAAK,MAAO,EAAK,MAAM,CACjE,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,kBACN,YAAa,gDACb,WAAY,EAAE,OAAO,CACnB,SAAU,EAAE,QAAQ,CAAC,SAAS,oBAAoB,CACnD,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CAEF,IAAM,EAAS,MADA,GAAc,CACD,UAAU,EAAK,SAAS,CACpD,OAAO,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { FastMCP } from "fastmcp";
2
+
3
+ //#region src/tools/utility.tools.d.ts
4
+ declare const registerUtilityTools: (server: FastMCP) => void;
5
+ //#endregion
6
+ export { registerUtilityTools };
7
+ //# sourceMappingURL=utility.tools.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{config as e,getAvailableSources as t}from"../lib/config.js";import{handleApiError as n}from"../lib/errors.js";import{z as r}from"zod";const i={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},a={0:`Unknown`,1:`Abandoned -- Failure to Respond to an Office Action`,2:`Abandoned -- Failure to Pay Issue Fee`,3:`Abandoned -- After Examiner's Answer or Board Decision`,5:`Abandoned -- Expressly Abandoned`,17:`Docketed New Case - Ready for Examination`,19:`Application Dispatched from Preexam, Not Yet Docketed`,20:`Awaiting TC Resp., Issue Fee Not Paid`,30:`Patented Case`,41:`Non Final Action Mailed`,44:`Advisory Action Mailed`,47:`Final Rejection Mailed`,60:`Response to Non-Final Office Action Entered and Forwarded to Examiner`,62:`Response after Non-Final Action Forwarded to Examiner`,63:`Response after Final Action Forwarded to Examiner`,70:`Notice of Allowance Mailed -- Application Received in Office of Publications`,71:`Issue Fee Payment Received`,80:`Sent to Classification Contractor`,85:`Response to Election/Restriction Filed`,90:`Application Undergoing Preexam Processing`,93:`Notice of Appeal Filed`,95:`Appeal Brief (or Coverage) Filed`,97:`On Appeal -- Awaiting Decision by the Board of Appeals`,100:`IDS Considered`,150:`Patent Expired Due to NonPayment of Maintenance Fees Under 37 CFR 1.362`,156:`Provisional Application Expired`,160:`RCE Filed`,161:`Application Ser No. Filing Date Fixed`,250:`Certificate of Correction Filed`,500:`Abandoned -- Incomplete Application`},o={A:`Human Necessities`,B:`Performing Operations; Transporting`,C:`Chemistry; Metallurgy`,D:`Textiles; Paper`,E:`Fixed Constructions`,F:`Mechanical Engineering; Lighting; Heating; Weapons; Blasting`,G:`Physics`,H:`Electricity`,Y:`General Tagging of New Technological Developments`},s={A01:`Agriculture; Forestry; Animal Husbandry; Hunting; Trapping; Fishing`,A23:`Foods or Foodstuffs; Treatment Thereof`,A61:`Medical or Veterinary Science; Hygiene`,A63:`Sports; Games; Amusements`,B01:`Physical or Chemical Processes or Apparatus in General`,B25:`Hand Tools; Portable Power-Driven Tools; Manipulators`,B29:`Working of Plastics; Working of Substances in a Plastic State in General`,B60:`Vehicles in General`,B65:`Conveying; Packing; Storing; Handling Thin or Filamentary Material`,C07:`Organic Chemistry`,C08:`Organic Macromolecular Compounds`,C12:`Biochemistry; Beer; Spirits; Wine; Vinegar; Microbiology; Enzymology; Mutation or Genetic Engineering`,E04:`Building`,F16:`Engineering Elements and Units`,G01:`Measuring; Testing`,G02:`Optics`,G05:`Controlling; Regulating`,G06:`Computing; Calculating or Counting`,G06F:`Electric Digital Data Processing`,G06N:`Computing Arrangements Based on Specific Computational Models (AI/ML)`,G06Q:`Information and Communication Technology for Administrative, Commercial, Financial, or Management Purposes`,G06T:`Image Data Processing or Generation`,G06V:`Image or Video Recognition or Understanding`,G08:`Signalling`,G09:`Educating; Cryptography; Display; Advertising; Seals`,G10:`Musical Instruments; Acoustics`,G11:`Information Storage`,G16:`Information and Communication Technology Specially Adapted for Specific Application Fields`,H01:`Electric Elements`,H02:`Generation; Conversion; or Distribution of Electric Power`,H03:`Electronic Circuitry`,H04:`Electric Communication Technique`,H04L:`Transmission of Digital Information`,H04N:`Pictorial Communication (Television)`,H04W:`Wireless Communication Networks`,H05:`Electric Techniques Not Otherwise Provided For`,H10:`Semiconductor Devices; Electric Solid-State Devices Not Otherwise Provided For`,Y02:`Technologies or Applications for Mitigation or Adaptation Against Climate Change`,Y10:`Technical Subjects Covered by Former USPC`},c=async(e,t,n)=>{try{let e=await fetch(t,{headers:n,signal:AbortSignal.timeout(1e4)});return e.ok?{healthy:!0}:{healthy:!1,error:`HTTP ${e.status}`}}catch(e){return{healthy:!1,error:e instanceof Error?e.message:String(e)}}},l=l=>{l.addTool({name:`check-api-status`,description:`Check the health and configuration status of all patent data APIs (PatentsView, ODP, EPO, BigQuery).`,parameters:r.object({}),annotations:i,execute:async()=>{try{let n=t(e),r=[],i={name:`PatentsView`,configured:n.find(e=>e.name===`PatentsView`)?.configured??!1,healthy:!1};{let t=e.patentsViewApiKey,n=await c(`PatentsView`,`https://search.patentsview.org/api/v1/patent/?q=%7B%7D&f=%5B%22patent_id%22%5D&o=%7B%22size%22%3A1%7D`,t?{"X-Api-Key":t}:void 0);i.healthy=n.healthy,i.error=n.error}r.push(i);let a={name:`ODP (USPTO Open Data Portal)`,configured:n.find(e=>e.name===`USPTO ODP`)?.configured??!1,healthy:!1};if(a.configured){let t=e.usptoApiKey,n=await c(`ODP`,`https://api.uspto.gov/api/v1/patent/applications/14412875`,t?{"X-API-KEY":t}:void 0);a.healthy=n.healthy,a.error=n.error}else a.error=`USPTO_API_KEY not set`;r.push(a);let o={name:`EPO (European Patent Office)`,configured:n.find(e=>e.name===`EPO OPS`)?.configured??!1,healthy:!1};o.configured||(o.error=`EPO_CONSUMER_KEY / EPO_CONSUMER_SECRET not set`),r.push(o);let s={name:`Google BigQuery (Patents Public Data)`,configured:n.find(e=>e.name===`Google BigQuery`)?.configured??!1,healthy:!1};return s.configured?s.healthy=!!e.googleApplicationCredentials:s.error=`GOOGLE_CLOUD_PROJECT / GOOGLE_APPLICATION_CREDENTIALS not set`,r.push(s),JSON.stringify({statuses:r})}catch(e){return n(e)}}}),l.addTool({name:`get-cpc-info`,description:`Look up CPC (Cooperative Patent Classification) code information. Returns the description for a given CPC section, class, or subclass code.`,parameters:r.object({code:r.string().describe(`CPC classification code (e.g., G06, H04L, A61)`)}),annotations:i,execute:async e=>{try{let t=e.code.toUpperCase().trim();if(s[t])return JSON.stringify({code:t,description:s[t],level:t.length<=3?`class`:`subclass`});if(t.length===1&&o[t])return JSON.stringify({code:t,description:o[t],level:`section`});let n=t.slice(0,3),r=t.slice(0,1),i={code:t,description:null,level:`unknown`};return s[n]&&(i.parentClass={code:n,description:s[n]}),o[r]&&(i.parentSection={code:r,description:o[r]}),!i.parentClass&&!i.parentSection&&(i.error=`No CPC data found for code: ${t}`),JSON.stringify(i)}catch(e){return n(e)}}}),l.addTool({name:`get-status-code`,description:`Look up the meaning of a USPTO application status code. Returns a human-readable description of what the status code indicates about the application's current state.`,parameters:r.object({code:r.string().describe(`USPTO application status code (numeric string)`)}),annotations:i,execute:async e=>{try{let t=e.code.trim(),n=a[t];return n?JSON.stringify({code:t,description:n}):JSON.stringify({code:t,description:null,error:`Unknown status code: ${t}. Common codes include: ${Object.keys(a).slice(0,10).join(`, `)}...`,availableCodes:Object.entries(a).map(([e,t])=>({code:e,description:t}))})}catch(e){return n(e)}}})};export{l as registerUtilityTools};
2
+ //# sourceMappingURL=utility.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility.tools.js","names":[],"sources":["../../src/tools/utility.tools.ts"],"sourcesContent":["import type { FastMCP } from \"fastmcp\"\nimport { z } from \"zod\"\n\nimport { config, getAvailableSources } from \"../lib/config\"\nimport { handleApiError } from \"../lib/errors\"\nimport type { ApiStatus } from \"../lib/types\"\n\nconst UTILITY_ANNOTATIONS = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n} as const\n\nconst STATUS_CODE_MAP: Record<string, string> = {\n \"0\": \"Unknown\",\n \"1\": \"Abandoned -- Failure to Respond to an Office Action\",\n \"2\": \"Abandoned -- Failure to Pay Issue Fee\",\n \"3\": \"Abandoned -- After Examiner's Answer or Board Decision\",\n \"5\": \"Abandoned -- Expressly Abandoned\",\n \"17\": \"Docketed New Case - Ready for Examination\",\n \"19\": \"Application Dispatched from Preexam, Not Yet Docketed\",\n \"20\": \"Awaiting TC Resp., Issue Fee Not Paid\",\n \"30\": \"Patented Case\",\n \"41\": \"Non Final Action Mailed\",\n \"44\": \"Advisory Action Mailed\",\n \"47\": \"Final Rejection Mailed\",\n \"60\": \"Response to Non-Final Office Action Entered and Forwarded to Examiner\",\n \"62\": \"Response after Non-Final Action Forwarded to Examiner\",\n \"63\": \"Response after Final Action Forwarded to Examiner\",\n \"70\": \"Notice of Allowance Mailed -- Application Received in Office of Publications\",\n \"71\": \"Issue Fee Payment Received\",\n \"80\": \"Sent to Classification Contractor\",\n \"85\": \"Response to Election/Restriction Filed\",\n \"90\": \"Application Undergoing Preexam Processing\",\n \"93\": \"Notice of Appeal Filed\",\n \"95\": \"Appeal Brief (or Coverage) Filed\",\n \"97\": \"On Appeal -- Awaiting Decision by the Board of Appeals\",\n \"100\": \"IDS Considered\",\n \"150\": \"Patent Expired Due to NonPayment of Maintenance Fees Under 37 CFR 1.362\",\n \"156\": \"Provisional Application Expired\",\n \"160\": \"RCE Filed\",\n \"161\": \"Application Ser No. Filing Date Fixed\",\n \"250\": \"Certificate of Correction Filed\",\n \"500\": \"Abandoned -- Incomplete Application\",\n}\n\nconst CPC_SECTION_MAP: Record<string, string> = {\n A: \"Human Necessities\",\n B: \"Performing Operations; Transporting\",\n C: \"Chemistry; Metallurgy\",\n D: \"Textiles; Paper\",\n E: \"Fixed Constructions\",\n F: \"Mechanical Engineering; Lighting; Heating; Weapons; Blasting\",\n G: \"Physics\",\n H: \"Electricity\",\n Y: \"General Tagging of New Technological Developments\",\n}\n\nconst CPC_CLASS_MAP: Record<string, string> = {\n A01: \"Agriculture; Forestry; Animal Husbandry; Hunting; Trapping; Fishing\",\n A23: \"Foods or Foodstuffs; Treatment Thereof\",\n A61: \"Medical or Veterinary Science; Hygiene\",\n A63: \"Sports; Games; Amusements\",\n B01: \"Physical or Chemical Processes or Apparatus in General\",\n B25: \"Hand Tools; Portable Power-Driven Tools; Manipulators\",\n B29: \"Working of Plastics; Working of Substances in a Plastic State in General\",\n B60: \"Vehicles in General\",\n B65: \"Conveying; Packing; Storing; Handling Thin or Filamentary Material\",\n C07: \"Organic Chemistry\",\n C08: \"Organic Macromolecular Compounds\",\n C12: \"Biochemistry; Beer; Spirits; Wine; Vinegar; Microbiology; Enzymology; Mutation or Genetic Engineering\",\n E04: \"Building\",\n F16: \"Engineering Elements and Units\",\n G01: \"Measuring; Testing\",\n G02: \"Optics\",\n G05: \"Controlling; Regulating\",\n G06: \"Computing; Calculating or Counting\",\n G06F: \"Electric Digital Data Processing\",\n G06N: \"Computing Arrangements Based on Specific Computational Models (AI/ML)\",\n G06Q: \"Information and Communication Technology for Administrative, Commercial, Financial, or Management Purposes\",\n G06T: \"Image Data Processing or Generation\",\n G06V: \"Image or Video Recognition or Understanding\",\n G08: \"Signalling\",\n G09: \"Educating; Cryptography; Display; Advertising; Seals\",\n G10: \"Musical Instruments; Acoustics\",\n G11: \"Information Storage\",\n G16: \"Information and Communication Technology Specially Adapted for Specific Application Fields\",\n H01: \"Electric Elements\",\n H02: \"Generation; Conversion; or Distribution of Electric Power\",\n H03: \"Electronic Circuitry\",\n H04: \"Electric Communication Technique\",\n H04L: \"Transmission of Digital Information\",\n H04N: \"Pictorial Communication (Television)\",\n H04W: \"Wireless Communication Networks\",\n H05: \"Electric Techniques Not Otherwise Provided For\",\n H10: \"Semiconductor Devices; Electric Solid-State Devices Not Otherwise Provided For\",\n Y02: \"Technologies or Applications for Mitigation or Adaptation Against Climate Change\",\n Y10: \"Technical Subjects Covered by Former USPC\",\n}\n\nconst checkApiHealth = async (\n name: string,\n url: string,\n headers?: Record<string, string>,\n): Promise<{ healthy: boolean; error?: string }> => {\n try {\n const response = await fetch(url, {\n headers,\n signal: AbortSignal.timeout(10000),\n })\n if (response.ok) return { healthy: true }\n return { healthy: false, error: `HTTP ${response.status}` }\n } catch (e) {\n return { healthy: false, error: e instanceof Error ? e.message : String(e) }\n }\n}\n\nexport const registerUtilityTools = (server: FastMCP): void => {\n server.addTool({\n name: \"check-api-status\",\n description: \"Check the health and configuration status of all patent data APIs (PatentsView, ODP, EPO, BigQuery).\",\n parameters: z.object({}),\n annotations: UTILITY_ANNOTATIONS,\n execute: async () => {\n try {\n const sources = getAvailableSources(config)\n const statuses: ApiStatus[] = []\n\n // PatentsView\n const pvSource = sources.find((s) => s.name === \"PatentsView\")\n const pvStatus: ApiStatus = {\n name: \"PatentsView\",\n configured: pvSource?.configured ?? false,\n healthy: false,\n }\n {\n const apiKey = config.patentsViewApiKey\n const healthResult = await checkApiHealth(\n \"PatentsView\",\n \"https://search.patentsview.org/api/v1/patent/?q=%7B%7D&f=%5B%22patent_id%22%5D&o=%7B%22size%22%3A1%7D\",\n apiKey ? { \"X-Api-Key\": apiKey } : undefined,\n )\n pvStatus.healthy = healthResult.healthy\n pvStatus.error = healthResult.error\n }\n statuses.push(pvStatus)\n\n // ODP (USPTO Open Data Portal)\n const odpSource = sources.find((s) => s.name === \"USPTO ODP\")\n const odpStatus: ApiStatus = {\n name: \"ODP (USPTO Open Data Portal)\",\n configured: odpSource?.configured ?? false,\n healthy: false,\n }\n if (odpStatus.configured) {\n const apiKey = config.usptoApiKey\n const healthResult = await checkApiHealth(\n \"ODP\",\n \"https://api.uspto.gov/api/v1/patent/applications/14412875\",\n apiKey ? { \"X-API-KEY\": apiKey } : undefined,\n )\n odpStatus.healthy = healthResult.healthy\n odpStatus.error = healthResult.error\n } else {\n odpStatus.error = \"USPTO_API_KEY not set\"\n }\n statuses.push(odpStatus)\n\n // EPO\n const epoSource = sources.find((s) => s.name === \"EPO OPS\")\n const epoStatus: ApiStatus = {\n name: \"EPO (European Patent Office)\",\n configured: epoSource?.configured ?? false,\n healthy: false,\n }\n if (!epoStatus.configured) {\n epoStatus.error = \"EPO_CONSUMER_KEY / EPO_CONSUMER_SECRET not set\"\n }\n statuses.push(epoStatus)\n\n // BigQuery\n const bqSource = sources.find((s) => s.name === \"Google BigQuery\")\n const bqStatus: ApiStatus = {\n name: \"Google BigQuery (Patents Public Data)\",\n configured: bqSource?.configured ?? false,\n healthy: false,\n }\n if (bqStatus.configured) {\n bqStatus.healthy = !!config.googleApplicationCredentials\n } else {\n bqStatus.error = \"GOOGLE_CLOUD_PROJECT / GOOGLE_APPLICATION_CREDENTIALS not set\"\n }\n statuses.push(bqStatus)\n\n return JSON.stringify({ statuses })\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"get-cpc-info\",\n description:\n \"Look up CPC (Cooperative Patent Classification) code information. Returns the description for a given CPC section, class, or subclass code.\",\n parameters: z.object({\n code: z.string().describe(\"CPC classification code (e.g., G06, H04L, A61)\"),\n }),\n annotations: UTILITY_ANNOTATIONS,\n execute: async (args) => {\n try {\n const code = args.code.toUpperCase().trim()\n\n if (CPC_CLASS_MAP[code]) {\n return JSON.stringify({\n code,\n description: CPC_CLASS_MAP[code],\n level: code.length <= 3 ? \"class\" : \"subclass\",\n })\n }\n\n if (code.length === 1 && CPC_SECTION_MAP[code]) {\n return JSON.stringify({\n code,\n description: CPC_SECTION_MAP[code],\n level: \"section\",\n })\n }\n\n const parentClass = code.slice(0, 3)\n const parentSection = code.slice(0, 1)\n\n const result: Record<string, unknown> = {\n code,\n description: null,\n level: \"unknown\",\n }\n\n if (CPC_CLASS_MAP[parentClass]) {\n result.parentClass = { code: parentClass, description: CPC_CLASS_MAP[parentClass] }\n }\n\n if (CPC_SECTION_MAP[parentSection]) {\n result.parentSection = { code: parentSection, description: CPC_SECTION_MAP[parentSection] }\n }\n\n if (!result.parentClass && !result.parentSection) {\n result.error = `No CPC data found for code: ${code}`\n }\n\n return JSON.stringify(result)\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n\n server.addTool({\n name: \"get-status-code\",\n description:\n \"Look up the meaning of a USPTO application status code. Returns a human-readable description of what the status code indicates about the application's current state.\",\n parameters: z.object({\n code: z.string().describe(\"USPTO application status code (numeric string)\"),\n }),\n annotations: UTILITY_ANNOTATIONS,\n execute: async (args) => {\n try {\n const code = args.code.trim()\n const description = STATUS_CODE_MAP[code]\n\n if (description) {\n return JSON.stringify({ code, description })\n }\n\n return JSON.stringify({\n code,\n description: null,\n error: `Unknown status code: ${code}. Common codes include: ${Object.keys(STATUS_CODE_MAP).slice(0, 10).join(\", \")}...`,\n availableCodes: Object.entries(STATUS_CODE_MAP).map(([c, d]) => ({ code: c, description: d })),\n })\n } catch (error) {\n return handleApiError(error)\n }\n },\n })\n}\n"],"mappings":"6IAOA,MAAM,EAAsB,CAC1B,aAAc,GACd,gBAAiB,GACjB,eAAgB,GAChB,cAAe,GAChB,CAEK,EAA0C,CAC9C,EAAK,UACL,EAAK,sDACL,EAAK,wCACL,EAAK,yDACL,EAAK,mCACL,GAAM,4CACN,GAAM,wDACN,GAAM,wCACN,GAAM,gBACN,GAAM,0BACN,GAAM,yBACN,GAAM,yBACN,GAAM,wEACN,GAAM,wDACN,GAAM,oDACN,GAAM,+EACN,GAAM,6BACN,GAAM,oCACN,GAAM,yCACN,GAAM,4CACN,GAAM,yBACN,GAAM,mCACN,GAAM,yDACN,IAAO,iBACP,IAAO,0EACP,IAAO,kCACP,IAAO,YACP,IAAO,wCACP,IAAO,kCACP,IAAO,sCACR,CAEK,EAA0C,CAC9C,EAAG,oBACH,EAAG,sCACH,EAAG,wBACH,EAAG,kBACH,EAAG,s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CAGJ,GAAI,EAAK,SAAW,GAAK,EAAgB,GACvC,OAAO,KAAK,UAAU,CACpB,OACA,YAAa,EAAgB,GAC7B,MAAO,UACR,CAAC,CAGJ,IAAM,EAAc,EAAK,MAAM,EAAG,EAAE,CAC9B,EAAgB,EAAK,MAAM,EAAG,EAAE,CAEhC,EAAkC,CACtC,OACA,YAAa,KACb,MAAO,UACR,CAcD,OAZI,EAAc,KAChB,EAAO,YAAc,CAAE,KAAM,EAAa,YAAa,EAAc,GAAc,EAGjF,EAAgB,KAClB,EAAO,cAAgB,CAAE,KAAM,EAAe,YAAa,EAAgB,GAAgB,EAGzF,CAAC,EAAO,aAAe,CAAC,EAAO,gBACjC,EAAO,MAAQ,+BAA+B,KAGzC,KAAK,UAAU,EAAO,OACtB,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC,CAEF,EAAO,QAAQ,CACb,KAAM,kBACN,YACE,wKACF,WAAY,EAAE,OAAO,CACnB,KAAM,EAAE,QAAQ,CAAC,SAAS,iDAAiD,CAC5E,CAAC,CACF,YAAa,EACb,QAAS,KAAO,IAAS,CACvB,GAAI,CACF,IAAM,EAAO,EAAK,KAAK,MAAM,CACvB,EAAc,EAAgB,GAMpC,OAJI,EACK,KAAK,UAAU,CAAE,OAAM,cAAa,CAAC,CAGvC,KAAK,UAAU,CACpB,OACA,YAAa,KACb,MAAO,wBAAwB,EAAK,0BAA0B,OAAO,KAAK,EAAgB,CAAC,MAAM,EAAG,GAAG,CAAC,KAAK,KAAK,CAAC,KACnH,eAAgB,OAAO,QAAQ,EAAgB,CAAC,KAAK,CAAC,EAAG,MAAQ,CAAE,KAAM,EAAG,YAAa,EAAG,EAAE,CAC/F,CAAC,OACK,EAAO,CACd,OAAO,EAAe,EAAM,GAGjC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "patents-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "FastMCP TypeScript patent intelligence MCP server — 55 tools across USPTO, EPO, and BigQuery",
5
+ "keywords": [
6
+ "mcp",
7
+ "patents",
8
+ "fastmcp",
9
+ "uspto",
10
+ "epo",
11
+ "patent-search"
12
+ ],
13
+ "author": "jordan.burke@gmail.com",
14
+ "license": "MIT",
15
+ "homepage": "https://github.com/sapientsai/patents-mcp-server",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/sapientsai/patents-mcp-server"
19
+ },
20
+ "devDependencies": {
21
+ "@hey-api/openapi-ts": "^0.94.1",
22
+ "@types/node": "^24.12.0",
23
+ "ts-builds": "^2.5.2",
24
+ "tsdown": "^0.21.2"
25
+ },
26
+ "bin": {
27
+ "patents-mcp-server": "./dist/index.js"
28
+ },
29
+ "type": "module",
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js",
37
+ "default": "./dist/index.js"
38
+ }
39
+ },
40
+ "files": [
41
+ "lib",
42
+ "dist"
43
+ ],
44
+ "prettier": "ts-builds/prettier",
45
+ "dependencies": {
46
+ "@google-cloud/bigquery": "^8.1.1",
47
+ "fast-xml-parser": "^5.5.5",
48
+ "fastmcp": "^3.34.0",
49
+ "functype": "^0.49.0",
50
+ "zod": "^4.3.6"
51
+ },
52
+ "scripts": {
53
+ "validate": "ts-builds validate",
54
+ "format": "ts-builds format",
55
+ "format:check": "ts-builds format:check",
56
+ "lint": "ts-builds lint",
57
+ "lint:check": "ts-builds lint:check",
58
+ "typecheck": "ts-builds typecheck",
59
+ "test": "ts-builds test",
60
+ "test:watch": "ts-builds test:watch",
61
+ "test:coverage": "ts-builds test:coverage",
62
+ "build": "ts-builds build",
63
+ "dev": "ts-builds dev",
64
+ "codegen": "openapi-ts",
65
+ "fetch-specs": "curl -s https://search.patentsview.org/static/openapi.json > src/specs/patentsview.json && gh api repos/patent-dev/uspto-odp/contents/swagger_fixed.yaml --jq '.content' | base64 -d > src/specs/uspto-odp.yaml"
66
+ }
67
+ }