Skip to main content
Glama

Query Trademarks

query_trademarks

Search US trademark records from the USPTO database. Filter results by trademark text, owner name, international class, status, and filing date range to find relevant trademark information.

Instructions

Search US trademarks from the USPTO. Filter by mark text, owner name, international class, status, and filing/registration date range. Source: USPTO TSDR and bulk XML data, updated weekly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mark_textNoTrademark text/name (partial match, e.g. 'APPLE')
owner_nameNoTrademark owner/applicant name (partial match)
international_classNoNice Classification code (e.g. '009' for computers/electronics)
statusNoTrademark status (e.g. REGISTERED, PENDING, ABANDONED, CANCELLED)
date_fromNoStart date for filing/registration (YYYY-MM-DD)
date_toNoEnd date for filing/registration (YYYY-MM-DD)
limitNoMaximum results to return (default 25, max 100)

Implementation Reference

  • Registration of the 'query_trademarks' tool on the MCP server via server.registerTool() with name 'query_trademarks', input schema, and handler.
    export function registerTrademarkTools(server: McpServer): void {
      // ── Query trademarks ────────────────────────────────────────────────────
    
      server.registerTool(
        "query_trademarks",
        {
          title: "Query Trademarks",
          description:
            "Search US trademarks from the USPTO. Filter by mark text, owner name, " +
            "international class, status, and filing/registration date range. " +
            "Source: USPTO TSDR and bulk XML data, updated weekly.",
          inputSchema: {
            mark_text: z
              .string()
              .optional()
              .describe("Trademark text/name (partial match, e.g. 'APPLE')"),
            owner_name: z
              .string()
              .optional()
              .describe("Trademark owner/applicant name (partial match)"),
            international_class: z
              .string()
              .optional()
              .describe("Nice Classification code (e.g. '009' for computers/electronics)"),
            status: z
              .string()
              .optional()
              .describe("Trademark status (e.g. REGISTERED, PENDING, ABANDONED, CANCELLED)"),
            date_from: z
              .string()
              .optional()
              .describe("Start date for filing/registration (YYYY-MM-DD)"),
            date_to: z
              .string()
              .optional()
              .describe("End date for filing/registration (YYYY-MM-DD)"),
            limit: z
              .number()
              .int()
              .min(1)
              .max(100)
              .optional()
              .describe("Maximum results to return (default 25, max 100)"),
          },
        },
        async ({ mark_text, owner_name, international_class, status, date_from, date_to, limit }) => {
          const res = await apiGet<TrademarkQueryResponse>("/api/v1/trademarks", {
            mark_text,
            owner_name,
            international_class,
            status,
            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} trademark(s).`;
          const json = JSON.stringify(data, null, 2);
    
          return {
            content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
          };
        },
      );
  • Handler function for query_trademarks that accepts optional filters (mark_text, owner_name, international_class, status, date_from, date_to, limit) and calls apiGet to /api/v1/trademarks, returning results or error.
    async ({ mark_text, owner_name, international_class, status, date_from, date_to, limit }) => {
      const res = await apiGet<TrademarkQueryResponse>("/api/v1/trademarks", {
        mark_text,
        owner_name,
        international_class,
        status,
        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} trademark(s).`;
      const json = JSON.stringify(data, null, 2);
    
      return {
        content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
      };
    },
  • Input schema definition for query_trademarks using Zod, defining optional string parameters (mark_text, owner_name, international_class, status, date_from, date_to) and an optional integer limit (1-100).
    inputSchema: {
      mark_text: z
        .string()
        .optional()
        .describe("Trademark text/name (partial match, e.g. 'APPLE')"),
      owner_name: z
        .string()
        .optional()
        .describe("Trademark owner/applicant name (partial match)"),
      international_class: z
        .string()
        .optional()
        .describe("Nice Classification code (e.g. '009' for computers/electronics)"),
      status: z
        .string()
        .optional()
        .describe("Trademark status (e.g. REGISTERED, PENDING, ABANDONED, CANCELLED)"),
      date_from: z
        .string()
        .optional()
        .describe("Start date for filing/registration (YYYY-MM-DD)"),
      date_to: z
        .string()
        .optional()
        .describe("End date for filing/registration (YYYY-MM-DD)"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum results to return (default 25, max 100)"),
    },
  • TypeScript interface TrademarkQueryResponse used by the handler to type the API response data.
    interface TrademarkQueryResponse {
      dataset: string;
      count: number;
      data: Record<string, unknown>[];
    }
  • apiGet helper function used by the 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,
      };
    }
Behavior3/5

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

With no annotations, the description provides some transparency by noting the data source (USPTO TSDR and bulk XML) and weekly updates. However, it does not disclose behavior like pagination, rate limits, or read-only nature.

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?

Two sentences front-loaded with the core action, followed by filter list and source. No wasted words.

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?

Given 7 optional parameters and no output schema, the description provides adequate context for a search tool but lacks details on return format, sorting, or default behavior.

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?

Schema description coverage is 100%, so the description adds only a summary of filter fields. It does not add new meaning beyond the schema, but it consolidates the parameters concisely.

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

Purpose4/5

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

The description clearly states it searches US trademarks from the USPTO and lists filterable fields, making the purpose obvious. However, it does not explicitly differentiate from sibling tool lookup_trademark, which likely retrieves by ID.

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

Usage Guidelines3/5

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

The description implies usage for searching trademarks with filters, but lacks guidance on when to use versus alternatives (e.g., lookup_trademark for specific records). No exclusions or prerequisites are mentioned.

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