Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use Notion REST API (not MCP) for batch operations (≥3 rows). Applies to database queries, batch updates, scans, pagination, file uploads, database creation, and page replication. MCP is acceptable only for single-page CRUD operations.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 90% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 118% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 24% | 0% |
Notion API (REST) is mandatory for batch operations; MCP (Model Context Protocol) is for single-page CRUD only.
Most Notion MCP implementations have critical limitations for scaled operations:
Real-world impact: A task requiring batch standardization of 65+ rows may take 4+ separate API calls via MCP (each capped at 25 results, no pagination), whereas the same task via Notion REST API with proper pagination completes in a single pass.
| Operation | Recommended Tool | Why | |-----------|---|---| | Create 1 page, read 1 page, update single entry, inline comment/annotation | MCP | Simpler setup, no auth management overhead | | Query entire database, batch update (≥3 rows), full scan/inventory, any operation requiring pagination | Notion REST API | Full pagination support, no result caps, complete control | | File upload (bulk or single) | Notion REST API | MCP rarely supports this; REST API has official file upload endpoints | | Database creation or replication of page structure | Notion REST API | Programmatic structure building requires full API control |
NOTION_TOKEN) or a credential vault; never hardcode.start_cursor and next_cursor for full retrieval.The Notion REST API covers pages (CRUD), databases (query with pagination), blocks (children enumeration), users, and comments. Rate limits are typically 3 requests/second; include backoff for 429 responses. Check the official API reference for the current version.
Example: Query a database with pagination
pythonimport os import requests NOTION_TOKEN = os.environ.get("NOTION_TOKEN") DATABASE_ID = "your-database-id" headers = { "Authorization": f"Bearer {NOTION_TOKEN}", "Notion-Version": "2024-06-15" } def query_db_paginated(db_id): """Retrieve all pages from a Notion database with automatic pagination.""" all_pages = [] start_cursor = None while True: payload = {} if start_cursor: payload["start_cursor"] = start_cursor response = requests.post( f"https://api.notion.com/v1/databases/{db_id}/query", headers=headers, json=payload ) response.raise_for_status() data = response.json() all_pages.extend(data["results"]) if not data.get("has_more"): break start_cursor = data.get("next_cursor") return all_pages # Fetch and process pages = query_db_paginated(DATABASE_ID) for page in pages: title = page["properties"]["Name"]["title"][0]["plain_text"] print(f"Page: {title}")
For repeated operations, create helper functions:
title, select, date, relation, etc.)paragraph, heading, code, etc.)Example helper:
pythondef update_page_property(page_id, property_name, property_value): """Update a single property on a Notion page with error handling.""" payload = { "properties": { property_name: property_value } } response = requests.patch( f"https://api.notion.com/v1/pages/{page_id}", headers=headers, json=payload ) if response.status_code == 429: # Rate limited; back off and retry raise Exception("Rate limited — implement exponential backoff") response.raise_for_status() return response.json()
POST /v1/databases/{database_id}/query — database query with filters and sortsGET /v1/databases/{database_id} — fetch database schemaPATCH /v1/pages/{page_id} — update page propertiesPOST /v1/pages/{page_id}/children — append blocks to a pageGET /v1/blocks/{block_id}/children — fetch children of a block with paginationWhen an AI agent is tasked with Notion data work:
has_more: false or consuming all cursors is a common failure mode.This decision pattern applies universally to AI agents working with Notion at scale, not just a single operator's workflow.
Other measured skills in the registry, with their headline benchmark lift.