Skip to main content
Glama

Query Patents

query_patents

Search US patents by title, assignee, inventor, or CPC section. Filter by patent type and grant date range to find relevant patents.

Instructions

Search US patents from the USPTO PatentsView database. Filter by patent title, assignee organization, inventor name, CPC section, patent type, and grant date range. Source: USPTO PatentsView API, updated weekly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patent_titleNoPatent title keyword search (partial match)
assigneeNoAssignee organization name (partial match, e.g. 'Google')
inventorNoInventor name (partial match, e.g. 'Smith')
cpc_sectionNoCPC section letter (A=Human Necessities, B=Operations, C=Chemistry, D=Textiles, E=Fixed Constructions, F=Mechanical Engineering, G=Physics, H=Electricity)
patent_typeNoPatent type: utility, design, plant, reissue
date_fromNoStart date for patent grant (YYYY-MM-DD)
date_toNoEnd date for patent grant (YYYY-MM-DD)
limitNoMaximum results to return (default 25, max 100)

Implementation Reference

  • The async handler function for the 'query_patents' tool. Accepts optional filters (patent_title, assignee, inventor, cpc_section, patent_type, date_from, date_to, limit), calls the Verilex API at /api/v1/patents, and returns formatted results.
    async ({ patent_title, assignee, inventor, cpc_section, patent_type, date_from, date_to, limit }) => {
      const res = await apiGet<PatentQueryResponse>("/api/v1/patents", {
        patent_title,
        assignee,
        inventor,
        cpc_section,
        patent_type,
        date_from,
        date_to,
        limit: limit ?? 25,
      });
    
      if (!res.ok) {
        return {
          content: [
            {
              type: "text" as const,
              text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
            },
          ],
          isError: true,
        };
      }
    
      const { count, data } = res.data;
      const summary = `Found ${count} patent(s).`;
      const json = JSON.stringify(data, null, 2);
    
      return {
        content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
      };
    },
  • Input schema for query_patents defined with Zod. Optional fields: patent_title, assignee, inventor, cpc_section, patent_type, date_from, date_to, limit (default 25, max 100).
    inputSchema: {
      patent_title: z
        .string()
        .optional()
        .describe("Patent title keyword search (partial match)"),
      assignee: z
        .string()
        .optional()
        .describe("Assignee organization name (partial match, e.g. 'Google')"),
      inventor: z
        .string()
        .optional()
        .describe("Inventor name (partial match, e.g. 'Smith')"),
      cpc_section: z
        .string()
        .optional()
        .describe("CPC section letter (A=Human Necessities, B=Operations, C=Chemistry, " +
          "D=Textiles, E=Fixed Constructions, F=Mechanical Engineering, G=Physics, H=Electricity)"),
      patent_type: z
        .string()
        .optional()
        .describe("Patent type: utility, design, plant, reissue"),
      date_from: z
        .string()
        .optional()
        .describe("Start date for patent grant (YYYY-MM-DD)"),
      date_to: z
        .string()
        .optional()
        .describe("End date for patent grant (YYYY-MM-DD)"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum results to return (default 25, max 100)"),
    },
  • Registration of the 'query_patents' tool via server.registerTool() with its schema and handler callback.
    server.registerTool(
      "query_patents",
      {
        title: "Query Patents",
        description:
          "Search US patents from the USPTO PatentsView database. Filter by patent title, " +
          "assignee organization, inventor name, CPC section, patent type, and grant date range. " +
          "Source: USPTO PatentsView API, updated weekly.",
        inputSchema: {
          patent_title: z
            .string()
            .optional()
            .describe("Patent title keyword search (partial match)"),
          assignee: z
            .string()
            .optional()
            .describe("Assignee organization name (partial match, e.g. 'Google')"),
          inventor: z
            .string()
            .optional()
            .describe("Inventor name (partial match, e.g. 'Smith')"),
          cpc_section: z
            .string()
            .optional()
            .describe("CPC section letter (A=Human Necessities, B=Operations, C=Chemistry, " +
              "D=Textiles, E=Fixed Constructions, F=Mechanical Engineering, G=Physics, H=Electricity)"),
          patent_type: z
            .string()
            .optional()
            .describe("Patent type: utility, design, plant, reissue"),
          date_from: z
            .string()
            .optional()
            .describe("Start date for patent grant (YYYY-MM-DD)"),
          date_to: z
            .string()
            .optional()
            .describe("End date for patent grant (YYYY-MM-DD)"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Maximum results to return (default 25, max 100)"),
        },
      },
      async ({ patent_title, assignee, inventor, cpc_section, patent_type, date_from, date_to, limit }) => {
        const res = await apiGet<PatentQueryResponse>("/api/v1/patents", {
          patent_title,
          assignee,
          inventor,
          cpc_section,
          patent_type,
          date_from,
          date_to,
          limit: limit ?? 25,
        });
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const { count, data } = res.data;
        const summary = `Found ${count} patent(s).`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • src/index.ts:18-18 (registration)
    Import of registerPatentTools from the patents module, which registers query_patents among other patent tools.
    import { registerPatentTools } from "./tools/patents.js";
  • The apiGet helper function used by the query_patents handler to make HTTP GET requests 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,
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries full burden for behavioral disclosure. It only mentions the data source and update frequency but does not state that the tool is read-only, whether it returns a list of patents, or any pagination behavior. Key behavioral traits like authentication needs or rate limits are omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading the purpose and listing key capabilities. It is efficient with no wasted words, making it easily scannable for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description provides source and update frequency, but lacks details about the output format (e.g., list of patents, fields returned, pagination). For a search tool with no output schema, this gap limits the agent's ability to interpret results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 8 parameters are fully described in the input schema (100% coverage), so the description adds no extra meaning beyond the schema. The listed filter fields in the description are redundant with schema. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches US patents from a specific database (USPTO PatentsView) and lists the filterable fields such as patent title, assignee, inventor, etc. It distinguishes from siblings like lookup_patent (which likely retrieves by ID) and patent_stats (which provides statistics), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus sibling tools like lookup_patent or patent_stats. It does not specify prerequisites or conditions under which the search is appropriate, nor does it mention alternative tools for different use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/carrierone/verilexdata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server