Skip to main content
Glama

query_database

Query a Notion database with optional filters, sorts, or text search to retrieve matching entries.

Instructions

Query a database with optional filters, sorts, or text search. Use text for simple keyword search across title, rich_text, url, email, and phone fields. For advanced filters, pass Notion filter syntax and call get_database first to see property names and valid options.

Response shape: { results: Array, warnings?: Array }. Multi-value properties are capped by max_property_items and can emit truncated_properties; read resources easy-notion://docs/property-pagination and easy-notion://docs/warnings for details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYesDatabase ID
filterNoOptional Notion filter object
sortsNoOptional Notion sorts array
textNoSearch text — matches across all text fields (title, rich_text, url, email, phone)
max_property_itemsNoMax items returned per multi-value property (title, rich_text, relation, people). Default 75. Set to 0 for unlimited. Negative values rejected. When the cap is hit, the response includes a truncated_properties warning with a how_to_fetch_all hint.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses response format (results and warnings), multi-value property truncation, and the meaning of text search. It mentions behavior around max_property_items and references docs for edge cases. A minor gap is not explicitly stating it's read-only, but the operation implies it.

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?

The description is two paragraphs: first covers usage, second covers response shape. It is reasonably concise and front-loaded. Every sentence adds value, though the second paragraph could be slightly tighter.

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?

Given the tool's complexity (5 params, nested objects), the description covers usage, response shape, warnings, and property truncation. It references external docs for details. Missing explicit contrast with query_view, but overall complete for agent use.

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 100%, so baseline is 3. The description adds value by explaining when to use text vs. filter, providing default for max_property_items, and warning about negative values and truncated properties. This goes beyond the schema's descriptions.

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 queries a database with optional filters, sorts, or text search. It specifies the action (query) and resource (database), distinguishing it from sibling tools like query_view by mentioning database-specific features. The scope is well-defined.

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 provides clear context on when to use text search vs. advanced filters, and advises calling get_database first for filter syntax. It does not explicitly exclude other tools like query_view, but the guidance is strong enough to lead the agent correctly.

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/Grey-Iris/easy-notion-mcp'

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