Run DQL Query
dqlRuns raw Diffbot Knowledge Graph queries for entity types and query shapes typed search tools don't cover, including products, patents, job posts, facets, cross-entity filters, and CSV exports.
Instructions
Runs a raw DQL query against the Diffbot Knowledge Graph. Prefer for entity types and query shapes the typed search tools do not cover: products, patents, job posts, facet aggregations, cross-entity queries, or an id filter from resolve_entities. Each typed tool returns the DQL it ran, which can be refined here. Conditions on one nested list object go inside one {} block, e.g. employments.{employer.name:X isCurrent:true}. Confirm field paths and taxonomy spellings with dql_ontology, since an unknown path is silently ignored. Do not add a sort unless ordering is the question. Check hit counts with dql_probe before pulling rows. For a CSV file, do not page rows: GET https://kg.diffbot.com/kg/v3/dql?token=..&format=csv&size=&exportspec=&query= for a download URL or save to disk. API docs: https://www.diffbot.com/docs/dql/
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": {
"query": "<query>"
},
"name": "dql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Max rows or buckets | |
| query | Yes | DQL, starting with type:X | |
| fields | No | CSV columns as 'path,Label;path,Label'; default per entity type | |
| format | No | 'json' for full records; add get:a,b to query to limit | csv |
| offset | No | Rows to skip | |
| hits_only | No | Count only |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||