Query USPTO Patent and Trademark Data
executeRun plain JavaScript in a sandbox to query USPTO patent and trademark APIs, filter searches, and return only the records you need.
Instructions
Run JavaScript inside a sandbox (no net, fs, env, or subprocess). Plain JS only — TypeScript type annotations are rejected. Globals: odp, tsdr. Top-level await is allowed; return the value you want as the result. USPTO serves one request at a time per API key, so calls are queued: prefer one well-filtered search (with fields to trim large records) over many lookups, and return only what you need.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript to run inside the sandbox (plain JS: TypeScript type annotations are rejected; top-level await/return are allowed). SDK globals: `odp` (USPTO Open Data Portal: patents, PTAB, petitions, office actions, bulk datasets) and `tsdr` (trademark status). | |
| memoryMb | No | ||
| timeoutMs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false when the code threw, timed out, or broke a limit; see error | |
| logs | Yes | ||
| error | No | ||
| value | No | The JSON value the code returned | |
| durationMs | Yes |