Skip to main content
Glama

notion_query_database

Query Notion databases with filters, sorting, pagination, and property selection to retrieve matching rows and their properties.

Instructions

Query a Notion database with optional filter, sort, and pagination.

Returns matching rows with their properties. Use notion_describe_database first to see the schema and property names.

database_id: the database to query. filter_json: Notion API filter object as JSON. Example: {"property": "Status", "select": {"equals": "Done"}} Compound example: {"and": [ {"property": "Status", "select": {"equals": "Active"}}, {"property": "Priority", "number": {"greater_than": 3}} ]} sorts_json: JSON array of sort objects. Example: [{"property": "Due", "direction": "ascending"}] Use "ascending" or "descending". limit: page size (default 50, max 100 — Notion's hard cap). start_cursor: opaque cursor returned by a previous call. Pass it to fetch the next page. When the output shows next_cursor: <token> the result set has more rows; when it shows next_cursor: (end) you have reached the end. properties: optional comma-separated list of property names to include (e.g. "Gmail Message ID, Invoice, Status"). Slims the output dramatically when you only need a few columns. The title column is always shown. Unknown names are ignored silently so a caller can ask for a union across a few databases.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
propertiesNo
sorts_jsonNo
database_idYes
filter_jsonNo
start_cursorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses important behaviors: pagination via opaque cursor with next_cursor token/end marker, the hard cap of 100, silent ignoring of unknown property names, and the always-shown title column. It does not mention error handling or rate limits, but the disclosed behaviors are substantial.

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?

The description is long but appropriately so for a tool with six parameters and JSON syntax. It is well-structured, alternating usage guidance with parameter definitions. Every sentence adds value—there is no fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of pagination, filters, and property selection, the description covers all invocation essentials: pagination semantics, default/max limits, property filtering behavior, and JSON formatting. It also notes an output schema exists, so return values need not be fully described in text. This is complete for an agent to select and call the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate. It does: every parameter (database_id, filter_json, sorts_json, limit, start_cursor, properties) is explained with JSON examples, defaults, constraints, and usage nuances. The examples for filter and sort are especially valuable.

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

Purpose5/5

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

The description clearly states the tool 'Query a Notion database with optional filter, sort, and pagination' and explains it returns matching rows with their properties. This provides a specific verb and resource, and the mention of pagination and filtering distinguishes it from simple search or read tools. The sibling reference to notion_describe_database further clarifies its role.

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

Usage Guidelines4/5

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

The description explicitly instructs to 'Use notion_describe_database first to see the schema and property names', establishing a clear prerequisite workflow. However, it does not explicitly discuss alternatives or when not to use this tool (e.g., full-text search vs. structured query), so it earns a 4 rather than a 5.

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/snickery/notion-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server