feat(integration): add 14 Notion functions#592
feat(integration): add 14 Notion functions#592TooonyChen wants to merge 1 commit intoaipotheosis-labs:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the Proxy Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughExpanded Notion REST coverage in backend/apps/notion/functions.json by adding endpoints for databases, blocks, page properties, and comments. Modified NOTION__GET_PAGE query parameter filter_properties from array to single string. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant NotionSvc as Notion Service (functions.json)
participant NotionAPI as Notion Public API
Note over Client,NotionAPI: High-level flow for new/updated endpoints
rect rgba(220,240,255,0.4)
Client->>NotionSvc: Create/Update/Query Database
NotionSvc->>NotionAPI: POST/PATCH/GET /databases...
NotionAPI-->>NotionSvc: Database payload
NotionSvc-->>Client: Response
end
rect rgba(235,255,235,0.4)
Client->>NotionSvc: Get/Update/Delete Block<br/>Append Block Children
NotionSvc->>NotionAPI: GET/PATCH/DELETE /blocks...<br/>PATCH /blocks/{id}/children
NotionAPI-->>NotionSvc: Block/Children payload
NotionSvc-->>Client: Response
end
rect rgba(255,245,220,0.5)
Client->>NotionSvc: Get Page / Get Page Property / Update Page
Note right of NotionSvc: filter_properties now single string
NotionSvc->>NotionAPI: GET /pages/{id}[?filter_properties]<br/>GET /pages/{id}/properties/{prop_id}<br/>PATCH /pages/{id}
NotionAPI-->>NotionSvc: Page/Property payload
NotionSvc-->>Client: Response
end
rect rgba(255,235,245,0.5)
Client->>NotionSvc: Create/Get Comments
NotionSvc->>NotionAPI: POST /comments, GET /comments/{id}|/comments
NotionAPI-->>NotionSvc: Comment(s)
NotionSvc-->>Client: Response
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Review by RecurseML🔍 Review performed on 2c12d12..533c6ef ✨ No bugs found, your code is sparkling clean ⏭️ Files skipped (low suspicion) (1)• |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (4)
backend/apps/notion/functions.json (4)
1366-1370: Add page_size bounds for consistency (GET_BLOCK_CHILDREN).- "page_size": { - "type": "integer", - "description": "The number of items from the full list desired in the response. Maximum: 100", - "default": 100 - } + "page_size": { + "type": "integer", + "description": "The number of items from the full list desired in the response. Maximum: 100", + "default": 100, + "minimum": 1, + "maximum": 100 + }
2146-2148: Add page_size bounds for consistency (GET_COMMENTS).- "page_size": { - "type": "integer", - "description": "The number of items from the full list desired in the response. Maximum: 100" - } + "page_size": { + "type": "integer", + "description": "The number of items from the full list desired in the response. Maximum: 100", + "minimum": 1, + "maximum": 100 + }
1284-1285: Nit: Wording.“contains has_children: true” → “has_children: true”.
- "description": "Retrieves a Block object using the ID specified. If the block contains has_children: true, use Retrieve block children to get the list of children.", + "description": "Retrieves a Block object using the ID specified. If the block has has_children: true, use Retrieve block children to get the list of children.",
1-62: Breaking change: GET_PAGE.filter_properties type changed.This alters the contract (array → string). If you stick with array (recommended), document migration; if you keep string, add a deprecation notice and update any callers. Also update docs checklist in the PR.
I can generate a migration note and search for impacted call sites if you want.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
backend/apps/notion/functions.json(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
backend/apps/*/{app.json,functions.json}
📄 CodeRabbit inference engine (CLAUDE.md)
Each integration in backend/apps/{app_name}/ must have both app.json and functions.json files
Files:
backend/apps/notion/functions.json
backend/apps/*/functions.json
📄 CodeRabbit inference engine (CLAUDE.md)
Integration functions.json files must define API endpoints and their schemas
Files:
backend/apps/notion/functions.json
backend/apps/**/*.json
📄 CodeRabbit inference engine (CLAUDE.md)
Backend integration definitions should be stored as JSON configs in backend/apps/
Files:
backend/apps/notion/functions.json
🔇 Additional comments (4)
backend/apps/notion/functions.json (4)
646-2173: Overall: Strong coverage and consistent schemas.Great addition of 14 endpoints with clear path/query/header separation and pagination patterns.
1-1: Remove incorrect note about missing app.json: the filebackend/apps/notion/app.jsonis present, so no changes are needed.Likely an incorrect or invalid review comment.
1609-1612: DELETE /blocks/{block_id} is supported by Notion API since September 10, 2021; safe to merge.
664-668: No update required for Notion-Version default
The default2022-06-28is confirmed as the latest stable Notion API version as of August 31 2025 (developers.notion.com)
| "filter_properties": { | ||
| "type": "array", | ||
| "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| "type": "string", | ||
| "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh." | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Revert filter_properties to array (supports repeated query param).
The Notion API allows multiple filter_properties by repeating the param. Modeling as a single string regresses multi-select. Suggest array of strings so the client can expand into repeated params.
- "filter_properties": {
- "type": "string",
- "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh."
- }
+ "filter_properties": {
+ "type": "array",
+ "description": "Repeatable query param. Provide an array of page property value IDs; the client will send them as repeated filter_properties params.",
+ "items": { "type": "string" }
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "filter_properties": { | |
| "type": "array", | |
| "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh.", | |
| "items": { | |
| "type": "string" | |
| } | |
| "type": "string", | |
| "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh." | |
| } | |
| ++ b/backend/apps/notion/functions.json | |
| @@ -31,7 +31,10 @@ | |
| "filter_properties": { | |
| - "type": "string", | |
| - "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh." | |
| "type": "array", | |
| "description": "Repeatable query param. Provide an array of page property value IDs; the client will send them as repeated filter_properties params.", | |
| "items": { | |
| "type": "string" | |
| } | |
| } |
🤖 Prompt for AI Agents
In backend/apps/notion/functions.json around lines 34 to 37, the
"filter_properties" schema is defined as a single string but the Notion API
accepts repeated query parameters; change the schema to an array of strings
(e.g., type: "array" with items: { type: "string" }) so the client can serialize
multiple values as repeated query params, and update any description to reflect
that multiple entries are supported.
| "filter_properties": { | ||
| "type": "string", | ||
| "description": "A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the filter criteria." | ||
| } | ||
| }, | ||
| "required": [], | ||
| "visible": ["filter_properties"], | ||
| "additionalProperties": false |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Align QUERY_DATABASE.filter_properties with GET_PAGE (array, not string).
Same reasoning as above; keep behavior consistent and multi-value capable.
- "filter_properties": {
- "type": "string",
- "description": "A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the filter criteria."
- }
+ "filter_properties": {
+ "type": "array",
+ "description": "Repeatable query param. Provide an array of page property value IDs; the client will send them as repeated filter_properties params.",
+ "items": { "type": "string" }
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "filter_properties": { | |
| "type": "string", | |
| "description": "A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the filter criteria." | |
| } | |
| }, | |
| "required": [], | |
| "visible": ["filter_properties"], | |
| "additionalProperties": false | |
| "filter_properties": { | |
| "type": "array", | |
| "description": "Repeatable query param. Provide an array of page property value IDs; the client will send them as repeated filter_properties params.", | |
| "items": { "type": "string" } | |
| } |
🤖 Prompt for AI Agents
In backend/apps/notion/functions.json around lines 1047 to 1054, the
QUERY_DATABASE parameter "filter_properties" is defined as a string but should
be an array like GET_PAGE to support multiple values; change its schema type
from "string" to "array", add "items": { "type": "string" } (or appropriate ID
type), and update "description" if needed to indicate it accepts multiple values
so behavior is consistent across endpoints.
| "properties": { | ||
| "type": "object", | ||
| "description": "The property values to update for the page. The keys are the names or IDs of the property and the values are property values. If a page property ID is not included, then it is not changed.", | ||
| "properties": { | ||
| "Name": { | ||
| "type": "object", | ||
| "description": "Title property for the page", | ||
| "properties": { | ||
| "title": { | ||
| "type": "array", | ||
| "description": "Rich text array for title", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "enum": ["text"], | ||
| "default": "text" | ||
| }, | ||
| "text": { | ||
| "type": "object", | ||
| "properties": { | ||
| "content": { | ||
| "type": "string", | ||
| "description": "The text content" | ||
| } | ||
| }, | ||
| "required": ["content"], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "required": ["type", "text"], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
| }, | ||
| "required": ["title"], | ||
| "visible": ["title"], | ||
| "additionalProperties": false | ||
| }, | ||
| "Status": { | ||
| "type": "object", | ||
| "description": "Select property for status", | ||
| "properties": { | ||
| "select": { | ||
| "type": "object", | ||
| "properties": { | ||
| "name": { | ||
| "type": "string", | ||
| "description": "Name of the select option" | ||
| } | ||
| }, | ||
| "required": ["name"], | ||
| "visible": ["name"], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "required": ["select"], | ||
| "visible": ["select"], | ||
| "additionalProperties": false | ||
| }, | ||
| "Price": { | ||
| "type": "object", | ||
| "description": "Number property for price", | ||
| "properties": { | ||
| "number": { | ||
| "type": "number", | ||
| "description": "Numeric value" | ||
| } | ||
| }, | ||
| "required": ["number"], | ||
| "visible": ["number"], | ||
| "additionalProperties": false | ||
| }, | ||
| "Available Date": { | ||
| "type": "object", | ||
| "description": "Date property for available date", | ||
| "properties": { | ||
| "date": { | ||
| "type": "object", | ||
| "properties": { | ||
| "start": { | ||
| "type": "string", | ||
| "description": "Start date in ISO 8601 format (YYYY-MM-DD)" | ||
| }, | ||
| "end": { | ||
| "type": "string", | ||
| "description": "End date in ISO 8601 format (YYYY-MM-DD)" | ||
| } | ||
| }, | ||
| "required": ["start"], | ||
| "visible": ["start", "end"], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "required": ["date"], | ||
| "visible": ["date"], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "required": [], | ||
| "visible": ["Name", "Status", "Price", "Available Date"], | ||
| "additionalProperties": true | ||
| }, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Make page property updates generic; avoid hard-coding keys.
Hard-coding Name/Status/Price/Available Date prevents updating arbitrary database schemas.
- "properties": {
- "type": "object",
- "description": "The property values to update for the page. The keys are the names or IDs of the property and the values are property values. If a page property ID is not included, then it is not changed.",
- "properties": {
- "Name": { ... },
- "Status": { ... },
- "Price": { ... },
- "Available Date": { ... }
- },
- "required": [],
- "visible": ["Name", "Status", "Price", "Available Date"],
- "additionalProperties": true
- },
+ "properties": {
+ "type": "object",
+ "description": "Arbitrary page properties keyed by name or ID. Values must follow Notion property value schema for the parent database.",
+ "additionalProperties": true
+ },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "properties": { | |
| "type": "object", | |
| "description": "The property values to update for the page. The keys are the names or IDs of the property and the values are property values. If a page property ID is not included, then it is not changed.", | |
| "properties": { | |
| "Name": { | |
| "type": "object", | |
| "description": "Title property for the page", | |
| "properties": { | |
| "title": { | |
| "type": "array", | |
| "description": "Rich text array for title", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "type": { | |
| "type": "string", | |
| "enum": ["text"], | |
| "default": "text" | |
| }, | |
| "text": { | |
| "type": "object", | |
| "properties": { | |
| "content": { | |
| "type": "string", | |
| "description": "The text content" | |
| } | |
| }, | |
| "required": ["content"], | |
| "additionalProperties": false | |
| } | |
| }, | |
| "required": ["type", "text"], | |
| "additionalProperties": false | |
| } | |
| } | |
| }, | |
| "required": ["title"], | |
| "visible": ["title"], | |
| "additionalProperties": false | |
| }, | |
| "Status": { | |
| "type": "object", | |
| "description": "Select property for status", | |
| "properties": { | |
| "select": { | |
| "type": "object", | |
| "properties": { | |
| "name": { | |
| "type": "string", | |
| "description": "Name of the select option" | |
| } | |
| }, | |
| "required": ["name"], | |
| "visible": ["name"], | |
| "additionalProperties": false | |
| } | |
| }, | |
| "required": ["select"], | |
| "visible": ["select"], | |
| "additionalProperties": false | |
| }, | |
| "Price": { | |
| "type": "object", | |
| "description": "Number property for price", | |
| "properties": { | |
| "number": { | |
| "type": "number", | |
| "description": "Numeric value" | |
| } | |
| }, | |
| "required": ["number"], | |
| "visible": ["number"], | |
| "additionalProperties": false | |
| }, | |
| "Available Date": { | |
| "type": "object", | |
| "description": "Date property for available date", | |
| "properties": { | |
| "date": { | |
| "type": "object", | |
| "properties": { | |
| "start": { | |
| "type": "string", | |
| "description": "Start date in ISO 8601 format (YYYY-MM-DD)" | |
| }, | |
| "end": { | |
| "type": "string", | |
| "description": "End date in ISO 8601 format (YYYY-MM-DD)" | |
| } | |
| }, | |
| "required": ["start"], | |
| "visible": ["start", "end"], | |
| "additionalProperties": false | |
| } | |
| }, | |
| "required": ["date"], | |
| "visible": ["date"], | |
| "additionalProperties": false | |
| } | |
| }, | |
| "required": [], | |
| "visible": ["Name", "Status", "Price", "Available Date"], | |
| "additionalProperties": true | |
| }, | |
| "properties": { | |
| "type": "object", | |
| "description": "Arbitrary page properties keyed by name or ID. Values must follow Notion property value schema for the parent database.", | |
| "additionalProperties": true | |
| }, |
| "in_trash": { | ||
| "type": "boolean", | ||
| "description": "Set to true to delete a block. Set to false to restore a block.", | ||
| "default": false | ||
| }, | ||
| "archived": { | ||
| "type": "boolean", | ||
| "description": "Set to true to archive a page. Set to false to restore a page.", | ||
| "default": false | ||
| }, |
There was a problem hiding this comment.
Remove in_trash from writable fields.
in_trash is read-only on pages; setting it has no effect and can mislead callers. archived is the supported control.
- "in_trash": {
- "type": "boolean",
- "description": "Set to true to delete a block. Set to false to restore a block.",
- "default": false
- },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "in_trash": { | |
| "type": "boolean", | |
| "description": "Set to true to delete a block. Set to false to restore a block.", | |
| "default": false | |
| }, | |
| "archived": { | |
| "type": "boolean", | |
| "description": "Set to true to archive a page. Set to false to restore a page.", | |
| "default": false | |
| }, | |
| "archived": { | |
| "type": "boolean", | |
| "description": "Set to true to archive a page. Set to false to restore a page.", | |
| "default": false | |
| }, |
🤖 Prompt for AI Agents
In backend/apps/notion/functions.json around lines 1868 to 1877, the schema
exposes "in_trash" as a writable boolean (with description and default) but that
field is read-only on pages and should not be presented as writable; remove the
entire "in_trash" property from the writable fields (or alternatively mark it
explicitly as readOnly: true and remove default) so callers cannot set it,
leaving "archived" as the supported writable control.
| "parent": { | ||
| "type": "object", | ||
| "description": "A page parent object. Either this or a discussion_id is required (not both)", | ||
| "properties": { | ||
| "page_id": { | ||
| "type": "string", | ||
| "description": "The ID of the page to comment on" | ||
| } | ||
| }, | ||
| "required": ["page_id"], | ||
| "visible": ["page_id"], | ||
| "additionalProperties": false | ||
| }, | ||
| "discussion_id": { | ||
| "type": "string", | ||
| "description": "A UUID identifier for a discussion thread. Either this or a parent object is required (not both)" | ||
| }, | ||
| "rich_text": { |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Enforce mutual exclusivity: parent.page_id XOR discussion_id.
Add oneOf at the body level so exactly one is provided.
"body": {
"type": "object",
"description": "Comment creation parameters",
+ "oneOf": [
+ { "required": ["parent"] },
+ { "required": ["discussion_id"] }
+ ],
"properties": {
"parent": {Also applies to: 1999-2002, 2060-2063
🤖 Prompt for AI Agents
In backend/apps/notion/functions.json around lines 1986-2003 (also apply same
change at 1999-2002 and 2060-2063), add a top-level oneOf for the request body
so exactly one of the two options is accepted: option A requires the parent
object with page_id (and explicitly forbids discussion_id), option B requires
discussion_id (and explicitly forbids parent). Implement the oneOf with two
subschemas—one that lists "required": ["parent"] and disallows discussion_id,
and the other that lists "required": ["discussion_id"] and disallows parent—so
parent.page_id XOR discussion_id is enforced.
| "items": { | ||
| "type": "string" | ||
| } | ||
| "type": "string", |
There was a problem hiding this comment.
Model filter_properties as an array of strings to support multiple values (repeated query params); using a single string removes multi-value support
Prompt for AI agents
Address the following comment on backend/apps/notion/functions.json at line 35:
<comment>Model filter_properties as an array of strings to support multiple values (repeated query params); using a single string removes multi-value support</comment>
<file context>
@@ -32,11 +32,8 @@
- "items": {
- "type": "string"
- }
+ "type": "string",
+ "description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: ?filter_properties=iAk8&filter_properties=b7dh."
}
</file context>
| "visible": ["Name", "Status", "Price", "Available Date"], | ||
| "additionalProperties": true | ||
| }, | ||
| "in_trash": { |
There was a problem hiding this comment.
Remove in_trash from the writable page update schema; it’s a read-only field on pages and will be ignored. Use the archived field to archive/unarchive pages instead
Prompt for AI agents
Address the following comment on backend/apps/notion/functions.json at line 1868:
<comment>Remove in_trash from the writable page update schema; it’s a read-only field on pages and will be ignored. Use the archived field to archive/unarchive pages instead</comment>
<file context>
@@ -644,5 +641,1534 @@
+ "visible": ["Name", "Status", "Price", "Available Date"],
+ "additionalProperties": true
+ },
+ "in_trash": {
+ "type": "boolean",
+ "description": "Set to true to delete a block. Set to false to restore a block.",
</file context>
| "visible": ["page_id"], | ||
| "additionalProperties": false | ||
| }, | ||
| "discussion_id": { |
There was a problem hiding this comment.
Enforce mutual exclusivity between parent.page_id and discussion_id using a oneOf constraint at the body level to prevent invalid payloads. (Based on your team's feedback about adding robust Notion functions.)
Prompt for AI agents
Address the following comment on backend/apps/notion/functions.json at line 1999:
<comment>Enforce mutual exclusivity between parent.page_id and discussion_id using a oneOf constraint at the body level to prevent invalid payloads. (Based on your team's feedback about adding robust Notion functions.)</comment>
<file context>
@@ -644,5 +641,1534 @@
+ "visible": ["page_id"],
+ "additionalProperties": false
+ },
+ "discussion_id": {
+ "type": "string",
+ "description": "A UUID identifier for a discussion thread. Either this or a parent object is required (not both)"
</file context>
| }, | ||
| "in_trash": { | ||
| "type": "boolean", | ||
| "description": "Set to true to delete a block. Set to false to restore a block.", |
There was a problem hiding this comment.
Description refers to 'block' in a page update; replace with 'page' to avoid confusion. (Based on your team's feedback about ensuring correctness in Notion schema.)
Prompt for AI agents
Address the following comment on backend/apps/notion/functions.json at line 1870:
<comment>Description refers to 'block' in a page update; replace with 'page' to avoid confusion. (Based on your team's feedback about ensuring correctness in Notion schema.)</comment>
<file context>
@@ -644,5 +641,1534 @@
+ },
+ "in_trash": {
+ "type": "boolean",
+ "description": "Set to true to delete a block. Set to false to restore a block.",
+ "default": false
+ },
</file context>
| "start_cursor": { | ||
| "type": "string", | ||
| "description": "When supplied, returns a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.", | ||
| "format": "uuid" |
There was a problem hiding this comment.
Avoid constraining start_cursor to a UUID; cursors are opaque strings and other endpoints in this file omit a format constraint, so this may reject valid cursors. (Based on your team's feedback about fixing schema issues to ensure proper AI interaction with the Notion API.)
Prompt for AI agents
Address the following comment on backend/apps/notion/functions.json at line 1110:
<comment>Avoid constraining start_cursor to a UUID; cursors are opaque strings and other endpoints in this file omit a format constraint, so this may reject valid cursors. (Based on your team's feedback about fixing schema issues to ensure proper AI interaction with the Notion API.)</comment>
<file context>
@@ -644,5 +641,1534 @@
+ "start_cursor": {
+ "type": "string",
+ "description": "When supplied, returns a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.",
+ "format": "uuid"
+ },
+ "page_size": {
</file context>
🏷️ Ticket
notion ticket
📝 Description
This PR significantly expands the Notion integration by adding 14 new functions and fixing critical schema issues to ensure proper AI interaction with the Notion API.
🆕 New Functions Added
CREATE_DATABASE,GET_DATABASE,UPDATE_DATABASE,QUERY_DATABASEAPPEND_BLOCK_CHILDREN,GET_BLOCK,GET_BLOCK_CHILDREN,UPDATE_BLOCK,DELETE_BLOCKGET_PAGE_PROPERTY,UPDATE_PAGE_PROPERTIESCREATE_COMMENT,GET_COMMENT,GET_COMMENTSGET_PAGEto change the filter_properties from array to string base on the notion API docs🎥 Demo (if applicable)
📸 Screenshots (if applicable)
fuzzy prompt and test result are here: notion page
✅ Checklist
Summary by cubic
Adds 14 Notion integration functions for databases, blocks, pages, and comments, and fixes the GET_PAGE schema for filter_properties. This brings broader API coverage and aligns parameters with Notion’s spec.
New Features
Migration
Summary by CodeRabbit
New Features
Refactor