Notion query_database tool: Filter not working on title properties & missing status/relation support. #895

Closed
opened 2026-02-16 10:20:53 -05:00 by yindo · 1 comment
Owner

Originally created by @Kota-Maeda on GitHub (Dec 24, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1

Plugin version

0.0.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Bug 1: Filter not working on title properties

  1. Create a Notion database with a title property (e.g., "Name")
  2. Add some pages to the database with different titles
  3. Use the query_database tool with filter parameters:
    • database_id: Your database ID
    • filter_property: "Name" (or any title property)
    • filter_value: "Test"
  4. Observe that the filter does not work correctly - either returns an error or ignores the filter

Expected behavior: Should return only pages where the title property equals "Test"

Actual behavior: Filter is ignored or returns an error because the tool creates a rich_text filter for title properties, which is incorrect according to Notion API specification.

Bug 2: Status and relation properties return placeholders

  1. Create a Notion database with status and relation properties
  2. Query the database using query_database tool
  3. Observe the results

Expected behavior: Should return actual status values (e.g., "In Progress", "Done") and relation page IDs

Actual behavior: Returns <status> and <relation> placeholders instead of actual values

Related issue: #1848

✔️ Error log

No response

Originally created by @Kota-Maeda on GitHub (Dec 24, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 ### Plugin version 0.0.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ### Bug 1: Filter not working on title properties 1. Create a Notion database with a title property (e.g., "Name") 2. Add some pages to the database with different titles 3. Use the `query_database` tool with filter parameters: - `database_id`: Your database ID - `filter_property`: "Name" (or any title property) - `filter_value`: "Test" 4. Observe that the filter does not work correctly - either returns an error or ignores the filter **Expected behavior**: Should return only pages where the title property equals "Test" **Actual behavior**: Filter is ignored or returns an error because the tool creates a `rich_text` filter for title properties, which is incorrect according to Notion API specification. ### Bug 2: Status and relation properties return placeholders 1. Create a Notion database with status and relation properties 2. Query the database using `query_database` tool 3. Observe the results **Expected behavior**: Should return actual status values (e.g., "In Progress", "Done") and relation page IDs **Actual behavior**: Returns `<status>` and `<relation>` placeholders instead of actual values **Related issue**: [#1848](https://github.com/langgenius/dify-official-plugins/pull/1848) ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:53 -05:00
yindo closed this issue 2026-02-16 10:20:53 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 24, 2025):

Hi @Kota-Maeda! I'm Dosu and I’m helping the dify-official-plugins team.

Both bugs you described are confirmed and reproducible in the current Notion plugin code. The filter on title properties does not work because the code always creates a rich_text filter, even for title fields, which the Notion API ignores or errors on—title properties require a title filter instead. For status and relation properties, the tool just returns placeholders like <status> and <relation> because it doesn't extract or format their actual values from the Notion API response. There are no merged fixes or documented workarounds for these issues as of the latest plugin version. If you need these features urgently, you would need to patch the filter construction to use the correct property type for titles and extend the property extraction logic to handle status and relation types properly. Otherwise, monitoring for updates or contributing a fix would be the best path forward.
See code details

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 24, 2025): <!-- Greeting --> Hi @Kota-Maeda! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> Both bugs you described are confirmed and reproducible in the current Notion plugin code. The filter on title properties does not work because the code always creates a `rich_text` filter, even for title fields, which the Notion API ignores or errors on—title properties require a `title` filter instead. For status and relation properties, the tool just returns placeholders like `<status>` and `<relation>` because it doesn't extract or format their actual values from the Notion API response. There are no merged fixes or documented workarounds for these issues as of the latest plugin version. If you need these features urgently, you would need to patch the filter construction to use the correct property type for titles and extend the property extraction logic to handle status and relation types properly. Otherwise, monitoring for updates or contributing a fix would be the best path forward. [See code details](https://github.com/langgenius/dify-official-plugins/blob/f7e9b3d0a3c0f89c5e140487ed1bfede86e6f4db/tools/notion/tools/query_database.py#L34-L102) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0df1a728-030c-41e9-91e6-68caac29841b?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Both%20bugs%20you%20described%20are%20confirmed%20and%20reproducible%20in%20the%20current%20Notion%20plugin%20code.%20The%20filter%20on%20title%20properties%20does%20not%20work%20because%20the%20code%20always%20creates%20a%20%60rich_text%60%20filter%2C%20even%20for%20title%20fields%2C%20which%20the%20Notion%20API%20ignores%20or%20errors%20on%E2%80%94title%20properties%20require%20a%20%60title%60%20filter%20instead.%20For%20status%20and%20relation%20properties%2C%20the%20tool%20just%20returns%20placeholders%20like%20%60%3Cstatus%3E%60%20and%20%60%3Crelation%3E%60%20because%20it%20doesn%27t%20extract%20or%20format%20their%20actual%20values%20from%20the%20Notion%20API%20response.%20There%20are%20no%20merged%20fixes%20or%20documented%20workarounds%20for%20these%20issues%20as%20of%20the%20latest%20plugin%20version.%20If%20you%20need%20these%20features%20urgently%2C%20you%20would%20need%20to%20patch%20the%20filter%20construction%20to%20use%20the%20correct%20property%20type%20for%20titles%20and%20extend%20the%20property%20extraction%20logic%20to%20handle%20status%20and%20relation%20types%20properly.%20Otherwise%2C%20monitoring%20for%20updates%20or%20contributing%20a%20fix%20would%20be%20the%20best%20path%20forward.%20%20%0A%5BSee%20code%20details%5D%28https%3A//github.com/langgenius/dify-official-plugins/blob/f7e9b3d0a3c0f89c5e140487ed1bfede86e6f4db/tools/notion/tools/query_database.py%23L34-L102%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2320)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#895