Skip to main content
Glama
notion-full-mcp
by cphoskins

query_database

Read-only

Retrieve rows from a Notion database with filters, sorts, and page size; narrow filters when results exceed the 500-row return limit.

Instructions

Query a Notion database with optional filters and sorts.

Args: database_id: The database to query. filter_json: JSON string for a Notion filter object. Leave empty for no filter. sorts_json: JSON string for a Notion sorts array. Leave empty for no sorting. page_size: Maximum rows per page fetch (max 100).

Returns at most 500 rows. truncated is true when more rows matched; narrow the filter to see the rest.

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_id": "<database_id>"
    },
    "name": "query_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
page_sizeNo
sorts_jsonNo
database_idYes
filter_jsonNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A3.9/5.0
Behavior4/5

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

Goes beyond the readOnlyHint/openWorldHint annotations by disclosing the hard 500-row return cap, the 'truncated' flag, and the page_size ceiling of 100 — behavior an agent cannot infer from annotations. It stops short of describing pagination mechanics (whether a cursor exists) or what happens if the filter JSON is malformed.

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?

Front-loaded one-line purpose followed by a compact Args list and a single return-value note; every sentence adds information and nothing is repeated from the schema.

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

Completeness4/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-structure detail is not needed, and the description still adds the truncated/cap semantics. The remaining gap is guidance on constructing the filter and sorts JSON strings.

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

Parameters4/5

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

Schema description coverage is 0%, so the Args block carries the load, and it defines all four parameters including defaults ('empty for no filter/sorting') and the page_size max. It does not specify the expected shape of the Notion filter/sorts JSON, which is the most error-prone input.

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?

Opens with a specific verb+resource ('Query a Notion database') and names the supported refinements (filters, sorts). It does not distinguish itself from the sibling get_database, so an agent cannot tell from the text alone which of the two retrieves database contents.

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

Usage Guidelines3/5

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

Useful hints exist — 'Leave empty for no filter' and 'narrow the filter to see the rest' — but there is no explicit statement of when to prefer this over get_database or search_pages, and no prerequisites or rate-limit context.

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