Skip to main content
Glama

query_database

Search and filter Notion databases using text queries or structured filters to find specific information based on criteria like status, dates, or keywords.

Instructions

Query a database with optional filters, sorts, or text search. Use text for simple keyword search across all text fields. For advanced filtering, use the filter parameter with Notion filter syntax:

  • Text contains: { "property": "Name", "title": { "contains": "keyword" } }

  • Select equals: { "property": "Status", "status": { "equals": "Done" } }

  • Checkbox: { "property": "Urgent", "checkbox": { "equals": true } }

  • Date after: { "property": "Due", "date": { "after": "2025-01-01" } }

  • Combine: { "and": [...] } or { "or": [...] } Call get_database first to see available properties and valid options.

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)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it's a read operation (implied by 'query'), supports optional parameters for filtering/sorting/searching, requires a database ID, and has specific syntax for filters. It also mentions the need to call 'get_database' first for metadata, adding useful context. However, it doesn't cover aspects like rate limits, pagination, or error handling.

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 appropriately sized and front-loaded, starting with the core purpose. The bullet points for filter syntax are well-structured for readability. However, it could be slightly more concise by integrating the 'Call get_database first' advice more seamlessly, and some sentences are lengthy but necessary for clarity.

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 (4 parameters, nested objects, no output schema, and no annotations), the description is largely complete. It covers purpose, usage, parameter semantics, and prerequisites. The main gap is the lack of output information (e.g., what the query returns, format, or pagination), which is significant since there's no output schema. Otherwise, it provides good contextual guidance for a query tool.

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?

The description adds significant meaning beyond the input schema, which has 100% coverage but minimal descriptions. It explains the purpose of each parameter: 'text' for simple keyword search across text fields, 'filter' for advanced filtering with Notion syntax, and 'sorts' for sorting. It provides concrete examples of filter syntax (e.g., text contains, select equals), clarifying how to use the parameters effectively, which the schema alone does not.

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?

The description clearly states the tool's purpose: 'Query a database with optional filters, sorts, or text search.' It specifies the verb ('query') and resource ('database'), distinguishing it from siblings like 'get_database' (which retrieves metadata) or 'search' (which may have broader scope). However, it doesn't explicitly contrast with all relevant siblings like 'list_pages' or 'search' in detail.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs. alternatives. It states: 'Use text for simple keyword search across all text fields. For advanced filtering, use the filter parameter...' and specifically advises: 'Call get_database first to see available properties and valid options.' This gives clear context for usage and prerequisites, though it doesn't explicitly list all sibling tools as alternatives.

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