Project

ask-notion

0.0
The project is in a healthy, maintained state
Provides authenticated Notion client, context metadata, and error guide for AI agents.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25
~> 3.1
~> 13.0

Runtime

 Project Readme

ask-notion

Notion service context for the ask-rb ecosystem.

Provides:

  • Ask::Notion.client — authenticated Notion API client
  • Ask::Notion::DESCRIPTION — context metadata for the system prompt
  • Ask::Notion::Errors — structured error knowledge for AI agents

Installation

gem "ask-notion"

Usage

require "ask-notion"

# Returns an authenticated Notion::Client
client = Ask::Notion.client

# Query a database
results = client.database_query(database_id: "your-database-id")

# Get a page
page = client.page_retrieve(page_id: "your-page-id")

# Create a page in a database
client.page_create(
  parent: { database_id: "your-database-id" },
  properties: {
    "Name" => { title: [{ text: { content: "New Task" } }] },
    "Status" => { status: { name: "In Progress" } }
  }
)

# Search across Notion
results = client.search(query: "project notes")

Auth Setup

This gem uses Ask::Auth to resolve the :notion_token credential.

  1. Go to https://www.notion.so/my-integrations
  2. Create a new integration and copy the Internal Integration Secret
  3. Set the token in your environment:
export NOTION_TOKEN="ntn_your_integration_token"

Or add it to ~/.ask/credentials.yml:

notion_token: ntn_your_integration_token

Development

bin/setup
bundle exec rake test

License

MIT