Tool

Integrate with Notion for Data Operations

LlamaIndex tool that lets an agent load, search, and append content in a Notion workspace.

Works with notion

75
Spark score
out of 100
Updated 2 days ago
Version 0.14.23
Models

Add to Favorites

Why it matters

Leverage your Notion workspace as a data source and destination within your AI applications. This asset enables seamless interaction with Notion pages and databases for data retrieval and content updates.

Outcomes

What it gets done

01

Load data from Notion pages and databases by ID.

02

Search for specific content within your Notion workspace.

03

Append new content to existing Notion pages or databases.

04

Utilize Notion data within AI agent workflows.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/li-tool-tools-notion | bash

Overview

Notion Tool

The Notion Tool wires a Notion workspace into a LlamaIndex agent as three callable functions: load pages or databases by ID, search for matching content, and append content to a page or database. Use it when an agent needs to read from or write to Notion. It requires a Notion API token.

What it does

The Notion Tool lets an agent load and update documents in Notion. It exposes three functions: load_data (loads a list of pages or databases by ID), search_data (searches for matching pages or databases), and append_data (appends content to a matching page or database). The user provides an API token to initialize NotionToolSpec.

When to use - and when NOT to

Use it when an agent needs to read from or write to Notion -- for example appending a heading to an existing page, as in agent.run("Append the heading 'I am legend' to the movies page"). It requires a Notion API token, so it is not usable without first setting one up in your Notion workspace.

Inputs and outputs

Given a page or database ID, load_data returns its content; a search query, search_data returns matching pages or databases; and content plus a target page, append_data writes it in. Attach it to an agent via to_tool_list():

from llama_index.tools.notion import NotionToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = NotionToolSpec()

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("Append the heading 'I am legend' to the movies page"))

Who it's for

Developers building LlamaIndex agents that need to read from, search, or write to a Notion workspace as part of a larger workflow.

Source README

Notion Tool

This tool loads and updates documents from Notion. The user specifies an API token to initialize the NotionToolSpec.

Usage

This tool has more extensive example usage documented in a Jupyter notebook here

Here's an example usage of the NotionToolSpec.

from llama_index.tools.notion import NotionToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = NotionToolSpec()

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("Append the heading 'I am legend' to the movies page"))

load_data: Loads a list of page or databases by id
search_data: Searches for matching pages or databases
append_data: Appends content to the matching page or database

This loader is designed to be used as a way to load data as a Tool in a Agent.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.