Skip to main content

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_token
Get your token from Notion Integrations.

Quick Start

1

Simple Usage

from praisonai_tools import NotionTool

# Initialize
notion = NotionTool()

# Search
results = notion.search("meeting notes")
print(results)
2

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

ErrorCauseSolution
NOTION_API_KEY not configuredMissing tokenSet environment variable
object_not_foundInvalid IDCheck page/database ID
unauthorizedNo accessShare page with integration

How It Works


Best Practices

Read the Notion token from the environment, never hard-code it.
Notion integrations only see pages explicitly shared with them — grant access first.
Notion throttles bursts. Retry with backoff so the agent stays responsive.

Confluence

Atlassian wiki

Google Docs

Google Docs

Trello

Task management