langchain - 💡(How to fix) Fix Add NotionSearchTool and NotionGetPageTool to langchain-community [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#37053Fetched 2026-04-29 06:11:32
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3issue_type_added ×1

Root Cause

Prior art

  • PR #33645 proposed documenting an external PyPI package (langchain-notion-tools) but was closed because docs have moved to a separate repo. No native tool code exists in langchain_community.
  • Several older closed issues requested Notion write/search capability but were never implemented.
RAW_BUFFERClick to expand / collapse

Submission checklist

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Feature Description

Motivation

LangChain currently has Notion document loaders (NotionDBLoader, NotionDirectoryLoader) but no native Notion tools in langchain-community, meaning agents cannot interactively search or read Notion pages during a conversation.

Prior art

  • PR #33645 proposed documenting an external PyPI package (langchain-notion-tools) but was closed because docs have moved to a separate repo. No native tool code exists in langchain_community.
  • Several older closed issues requested Notion write/search capability but were never implemented.

This proposal fills that gap natively inside langchain_community.

Proposed solution

Add two tools to langchain_community/tools/notion/:

  • NotionSearchTool — searches workspace via POST /v1/search
  • NotionGetPageTool — fetches page blocks via GET /v1/blocks/{id}/children

Implementation plan

  • Full BaseTool interface with Pydantic v2 validation
  • SecretStr for API key handling (never logged or exposed)
  • Google-style docstrings with Args, Returns, and Example sections
  • Unit tests with fully mocked HTTP calls
  • Proper registration in all init.py files

API reference

Notion public API (free, user-provided integration token) https://developers.notion.com/reference/intro

Happy to implement this if maintainers are open to it.

Use Case

Use cases

  1. Meeting notes agent A team uses Notion as their knowledge base. An LLM agent can search Notion for past meeting notes relevant to a current topic and summarize them — without any manual copy-pasting.

  2. Research assistant A user asks an agent "find everything we have on competitor X." The agent searches Notion, retrieves relevant pages, and compiles a structured summary on the fly.

  3. Onboarding bot A new employee asks a Slack bot questions. The bot uses NotionSearchTool to find relevant internal docs and answers grounded in the company's actual Notion workspace.

  4. Personal productivity agent A user says "find my Q3 goals page and tell me what I haven't completed." The agent searches Notion, reads the page content, and cross-references it with other context.

  5. RAG over live Notion data Instead of a static document dump, an agent dynamically fetches the latest version of a Notion page at query time — always working with up-to-date content rather than a stale snapshot.

Proposed Solution

Proposed solution

Add two native tools to langchain_community/tools/notion/:

NotionSearchTool

  • Calls POST https://api.notion.com/v1/search
  • Accepts a natural language query string
  • Returns matching page titles and their IDs
  • Useful for agents that need to locate relevant pages dynamically

NotionGetPageTool

These two tools work together naturally in an agent loop:

  1. Agent calls NotionSearchTool("Q3 OKRs") → gets page ID
  2. Agent calls NotionGetPageTool(page_id) → reads the content
  3. Agent reasons over the content and responds to the user

What makes this different from the existing NotionDBLoader:

  • NotionDBLoader is a one-time document loader for indexing
  • These are agent tools — callable mid-conversation, on demand
  • No need to pre-load or re-index when data changes in Notion

Alternatives Considered

No response

Additional Context

No response

extent analysis

TL;DR

Implementing NotionSearchTool and NotionGetPageTool in langchain_community/tools/notion/ will enable agents to interactively search and read Notion pages during conversations.

Guidance

  • Review the Notion API documentation to ensure compliance with the latest API versions and requirements.
  • Implement the proposed NotionSearchTool and NotionGetPageTool with proper error handling and validation.
  • Ensure the tools are properly registered in all init.py files and follow the Full BaseTool interface with Pydantic v2 validation.
  • Develop unit tests with fully mocked HTTP calls to verify the tools' functionality.

Example

from langchain_community.tools.notion import NotionSearchTool, NotionGetPageTool

# Search for pages containing "Q3 OKRs"
search_tool = NotionSearchTool()
page_id = search_tool("Q3 OKRs")

# Get the content of the page
get_page_tool = NotionGetPageTool()
page_content = get_page_tool(page_id)

Notes

The implementation should handle potential errors, such as API rate limits, invalid page IDs, and network issues. Additionally, consider implementing caching mechanisms to reduce the number of API calls.

Recommendation

Apply the proposed solution by implementing the NotionSearchTool and NotionGetPageTool in langchain_community/tools/notion/, as it will provide the necessary functionality for agents to interact with Notion pages during conversations.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - 💡(How to fix) Fix Add NotionSearchTool and NotionGetPageTool to langchain-community [1 participants]