Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Notion tool allows you to search, create, and update pages and databases in Notion.

Installation

pip install "praisonai[tools]"

Environment Variables

export NOTION_API_KEY=your_integration_token
Get your token from Notion Integrations.

Quick Start

from praisonai_tools import NotionTool

# Initialize
notion = NotionTool()

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

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