Skip to main content
Glama

notion_query_database

Query rows in a Notion database via collection URL using row mode or SQL filters and parameters. Fetch the database first for its URL and columns.

Instructions

Query rows of a database. Fetch the database first for its collection:// URL and columns. Everything goes inside data, e.g. {"data": {"mode": "rows", "data_source_url": "collection://…", "limit": 20}}, or SQL: {"data": {"data_source_urls": ["collection://…"], "query": "SELECT * FROM [collection://…] WHERE Status = ?", "params": ["Done"]}}.

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": {
      "account": "<account>",
      "data": "<data>"
    },
    "name": "notion_query_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe query: mode, data source URL(s), filters.
accountYesWhich connected account (alias) to act as, e.g. "business".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavior burden, and it does disclose the two payload modes (rows mode vs. raw SQL with params) plus the prerequisite fetch step. It says nothing about read-only guarantees, pagination of results, ordering, or permission requirements, which are material for an unbounded query tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and the prerequisite, then concrete JSON examples that earn their space given the nested, untyped `data` object. The inline payload blobs are dense but functional; nothing is pure 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 nested-object tool with no annotations and no output schema, the description adequately covers input shape and the fetch-first workflow. It leaves the agent without any sense of what rows come back, how large results are, or how to page, which matters for a query tool with an optional limit.

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

Parameters3/5

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

Schema description coverage is 100% at the top level, but the schema only labels `data` as 'The query: mode, data source URL(s), filters,' which is too vague to be actionable on its own. The description compensates well by giving two exact payload shapes (mode/data_source_url/limit and data_source_urls/query/params), effectively documenting the nested fields the schema leaves open — a genuine lift above baseline, but it never explains what modes are valid beyond the examples or what `account` aliases resolve to.

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 database') and adds the scoping detail that the database must be fetched first for its collection:// URL and columns. That distinguishes it from notion_fetch, which supplies the prerequisite metadata, though the description never names notion_fetch explicitly, so the sibling distinction is implied rather than asserted.

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 concrete precondition: fetch the database first to obtain the collection:// URL and columns, which tells an agent where this tool sits in the workflow. It does not state when to prefer this over notion_search or when it should not be used, so exclusions and alternatives are absent.

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