Skip to main content
Glama

query_database

Query rows in a Notion database using optional Notion API filter and sorts JSON, with pagination via cursor and row limits. Enables targeted data retrieval from cached or live databases.

Instructions

Query rows of a Notion database with optional Notion API JSON filter and sorts. filter and sorts are rejected with offline:true. Cost: one request per 100 rows up to limit; offline:true makes none.

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": "query_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
sortsNoOptional Notion API sorts JSON array
cursorNonext_cursor from a previous reply
filterNoOptional Notion API filter JSON object
offlineNo
databaseYesDatabase ID, URL, or title

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose real behavior: the cost model (one request per 100 rows, capped by limit), that offline:true performs no requests, and that offline mode rejects filter and sorts. What is missing is explicit confirmation that the operation is non-mutating and any note on rate limiting or error behavior when a filter 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?

Three short sentences with the primary action front-loaded, followed by the constraint and then the cost. The telegraphic 'offline:true makes none' phrase is terse but unambiguous in context; no sentence is filler.

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

Completeness3/5

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

For a six-parameter tool with a nested filter object and no annotations or output schema, the description covers the tricky interactions (offline, cost, filter rejection) but says nothing about what a successful result contains or how pagination via cursor should be driven. It is adequate to invoke the tool, not fully complete.

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 coverage is 67% and the description adds genuine meaning beyond it: it explains that filter and sorts expect Notion API JSON, and — importantly — that these two parameters are rejected when offline is true, an interaction not visible anywhere in the schema. It leaves limit's relationship to cost partially explained and says nothing about database resolution (ID vs URL vs title), so it is good but not exhaustive.

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 rows of a Notion database', with the accepted filter/sorts inputs named. It is clearly a read operation on database rows, distinguishable in kind from write-oriented siblings like create_database_item or update_database_item, though it never names an alternative tool explicitly.

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?

The description gives a conditional rule ('filter and sorts are rejected with offline:true') and a cost rule, which implicitly tells the agent when to avoid offline mode with filters. However it never says when to choose this over list_databases or get_page, nor what happens for databases vs pages. Usage is implied rather than prescribed.

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