Prerequisites
To useNotionTools, you need to install notion-client:
Step 1: Create a Notion Integration
- Go to https://www.notion.so/my-integrations
- Click on ”+ New integration”
- Fill in the details:
- Name: Give it a name like “Agno Query Classifier”
- Associated workspace: Select your workspace
- Type: Internal integration
- Click “Submit”
- Copy the “Internal Integration Token” (starts with
secret_)- ⚠️ Keep this secret! This is your
NOTION_API_KEY
- ⚠️ Keep this secret! This is your
Step 2: Create a Notion Database
- Open Notion and create a new page
- Add a Database (you can use “/database” command)
- Set up the database with these properties:
- Name (Title) - Already exists by default
- Tag (Select) - Click ”+” to add a new property
- Property type: Select
- Property name: Tag
- Add these options:
- travel
- tech
- general-blogs
- fashion
- documents
Step 3: Share Database with Your Integration
- Open your database page in Notion
- Click the ”…” (three dots) menu in the top right
- Scroll down and click “Add connections”
- Search for your integration name (e.g., “Agno Query Classifier”)
- Click on it to grant access
Step 4: Get Your Database ID
Your database ID is in the URL of your database page:database_id is the 32-character string (with hyphens) between the workspace name and the ?v=.
Example:
Example
The following example demonstrates how to useNotionTools to create, update and search for Notion pages with specific tags.
Toolkit Functions
These are the functions exposed byNotionTools:
Toolkit Params
These parameters are passed to theNotionTools constructor:
Developer Resources
- View Tools