Notion
Interact with Notion databases and pages
Overview
Notion tool allows you to search, create, and update pages and databases in Notion.
The user asks to read or update a page; the agent calls Notion and returns the outcome.
Installation
pip install "praisonai[tools]"Environment Variables
export NOTION_API_KEY=your_integration_tokenGet your token from Notion Integrations.
Quick Start
- Simple Usage
python from praisonai_tools import NotionTool # Initialize notion = NotionTool() # Search results = notion.search("meeting notes") print(results) - With Configuration
Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.
Usage with Agent
from praisonaiagents import Agent
from praisonai_tools import NotionTool
agent = Agent(
name="NotionAssistant",
instructions="You help manage Notion pages and databases.",
tools=[NotionTool()]
)
response = agent.chat("Create a new page titled 'Project Plan'")
print(response)Available Methods
search(query)
Search Notion pages and databases.
from praisonai_tools import NotionTool
notion = NotionTool()
results = notion.search("project")create_page(parent_id, title, content)
Create a new page.
notion.create_page(
parent_id="database_id",
title="New Page",
content="Page content here"
)get_page(page_id)
Get page content.
page = notion.get_page("page_id")Common Errors
| Error | Cause | Solution |
|---|---|---|
NOTION_API_KEY not configured | Missing token | Set environment variable |
object_not_found | Invalid ID | Check page/database ID |
unauthorized | No access | Share page with integration |
How It Works
Best Practices
Store the integration token securely
Read the Notion token from the environment, never hard-code it.
Share pages with the integration
Notion integrations only see pages explicitly shared with them — grant access first.
Handle rate limits
Notion throttles bursts. Retry with backoff so the agent stays responsive.