notion_query_database
Pack: notion_connect · Endpoint: https://gateway.pipeworx.io/notion_connect/mcp
Query a Notion database with filters and sorting (e.g., status=‘Done’, sort by date). Returns matching rows with property values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
database_id | string | yes | Notion database ID to query |
filter | object | no | Notion filter object (e.g., { “property”: “Status”, “select”: { “equals”: “Done” } }) |
sorts | array | no | Array of sort objects (e.g., [{ “property”: “Created”, “direction”: “descending” }]) |
page_size | number | no | Number of results to return (default 10, max 100) |
start_cursor | string | no | Pagination cursor for next page of results |
Example call
Arguments
{
"database_id": "a1b2c3d4e5f641d4a716446655440000"
}
curl
curl -X POST https://gateway.pipeworx.io/notion_connect/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"notion_query_database","arguments":{"database_id":"a1b2c3d4e5f641d4a716446655440000"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('notion_query_database', {
"database_id": "a1b2c3d4e5f641d4a716446655440000"
});
More examples
{
"database_id": "a1b2c3d4e5f641d4a716446655440000",
"filter": {
"property": "Status",
"select": {
"equals": "Done"
}
},
"sorts": [
{
"property": "Created",
"direction": "descending"
}
],
"page_size": 25
}
Response shape
| Field | Type | Description |
|---|---|---|
object | string | Always ‘list’ |
results | array | Array of matching database rows (pages) |
next_cursor | string | null | Pagination cursor for next page |
has_more | boolean | Whether more results exist |
Full JSON Schema
{
"type": "object",
"properties": {
"object": {
"type": "string",
"description": "Always 'list'"
},
"results": {
"type": "array",
"description": "Array of matching database rows (pages)",
"items": {
"type": "object",
"properties": {
"object": {
"type": "string",
"description": "Object type ('page')"
},
"id": {
"type": "string",
"description": "Page ID"
},
"created_time": {
"type": "string",
"description": "ISO 8601 creation timestamp"
},
"last_edited_time": {
"type": "string",
"description": "ISO 8601 last edit timestamp"
},
"properties": {
"type": "object",
"description": "Row property values"
},
"url": {
"type": "string",
"description": "Notion web URL"
}
}
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Pagination cursor for next page"
},
"has_more": {
"type": "boolean",
"description": "Whether more results exist"
}
}
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"notion_connect": {
"url": "https://gateway.pipeworx.io/notion_connect/mcp"
}
}
}
See Getting Started for client-specific install steps.