Query Database
notion_queryQuery Notion database rows with structured filters, operators, relative dates, and sorting; returns matching rows and page IDs. Use for finding or listing database entries, not for counts or totals.
Instructions
Query database rows. where takes equality ({"Status": "Done"}), operators ({"Due": {"before": "today"}}, {"Estimate": {">": 500}}, {"Task": {"contains": "x"}}, {"Owner": null}), lists ({"Status": {"in": ["Done", "Blocked"]}}), {"or": [...]}, relative dates ("today", "+7d", "-2w"), and "$created"/"$last_edited"; names and options are matched forgivingly and validated. filter takes raw Notion filter JSON; both are combined with AND. Returns rows with simple values and page ids. For counts or totals use notion_aggregate instead of reading every row.
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": {
"database": "<database>"
},
"name": "notion_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| sorts | No | ||
| where | No | ||
| cursor | No | next_cursor from a previous call. | |
| filter | No | ||
| database | Yes | Database URL/id or data source id. | |
| properties | No | Only return these properties (saves context). | |
| data_source_name | No |