Skip to main content
Glama

notion_query_database

Retrieve matching rows from a Notion database using optional filters, sorting, pagination, and property selection.

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}} ]} Status properties can also be filtered by group (To-do / In progress / Complete): {"property": "Status", "status": {"group_equals": "In progress"}} 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. archived: True returns the database's archived rows instead of the active ones.

Input Schema

NameRequiredDescriptionDefault
limitNo
archivedNo
propertiesNo
sorts_jsonNo
database_idYes
filter_jsonNo
start_cursorNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.2
    • addedInput schema / properties / archived
      Added value: +{
      +  "default": false,
      +  "title": "Archived",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and discloses key behavior: returned rows, pagination cursor semantics, the 100-row hard cap, archived-row switching, and silent ignoring of unknown property names. It does not explicitly state read-only/no side effects or mention auth or rate limits, leaving some behavioral gaps.

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 front-loaded with purpose and a prerequisite, then uses a clean parameter-by-parameter structure. Its length is justified by the zero schema coverage and the complexity of filter/sort JSON.

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?

An output schema exists, so return-value explanation is not required, but the description still adds useful cursor-end semantics. Given seven parameters with no schema descriptions and no annotations, the description provides enough operational detail to call the tool correctly.

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 compensate, and it does: every parameter is explained with examples and constraints. filter_json and sorts_json include JSON examples, limit gives default and max, start_cursor explains pagination, properties explains comma-separated slimming, and archived explains the alternate result set.

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

Purpose4/5

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

States a specific verb and resource: query a Notion database, returning matching rows with their properties. It is clear, but it does not explicitly differentiate this from sibling tools like notion_query_view or notion_search_pages.

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?

Gives a clear prerequisite workflow: call notion_describe_database first to learn the schema and property names. It lacks explicit when-not conditions or guidance versus sibling query/search tools, so it is strong but not complete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.