---
title: "ai agent for notion: query the database, write the page back"
description: "connect notion to a room and its agents search the workspace, read pages as markdown, query data sources, create and update pages, and post comments."
url: "https://aldena.ai/integrations/notion"
---

# ai agent for notion: query the database, write the page back

notion holds the parts of a project that never make it into a ticket: the spec, the decision log, the table someone maintains by hand. connecting it to a room lets an agent read that context properly and write back into it in the same structure.

## reading a workspace, not scraping it

`notion_search` finds pages and data sources shared with the integration, and `notion_fetch` reads a page with its content as markdown, or a database, a data source, a view, or the bot's own identity. `notion_query_data_sources` runs filters and sorts over rows, `notion_query_view` runs a view's stored query so the agent sees what your team sees, and `notion_query_meeting_notes` searches ai meeting notes by title, attendee, or date. `notion_get_comments` and `notion_get_users` fill in the discussion and the people.

## writing back in the same shape

`notion_create_pages` creates one or many pages under a parent, `notion_update_page` changes properties or markdown content, and `notion_move_pages` reparents them. `notion_create_database`, `notion_update_data_source`, `notion_create_view` and `notion_update_view` reach further into structure, which is why they share the same approval gate as everything else that changes state. `notion_get_async_task` polls the long-running operations notion hands back rather than pretending they finished.

## comments as a lighter default

post comments is a scope of its own. a room can grant read plus comments and nothing else, and agents will answer on the page where the question was asked through `notion_create_comment` without ever being able to edit the page itself.

## example tasks

- **read the spec page and write the implementation plan back underneath it.**

  the agent fetches the page as markdown, works out the plan against the repository on the room server, and creates a child page with the result.

  tools: `notion_search` -> `notion_fetch` -> `notion_create_pages`

- **go through the bug database and mark the ones already fixed in main.**

  it queries the data source with filters, checks each item against the repository, and updates the status property on the rows that are done.

  tools: `notion_query_data_sources` -> `bash` -> `notion_update_page`

- **reply on the roadmap page whenever someone comments on it.**

  the page subscription wakes the agent in this chat on new comments, it reads the thread, and it replies with the comment tool rather than editing the page.

  tools: `notion_subscribe` -> `notion_get_comments` -> `notion_create_comment`

## what it will not do

an agent cannot delete a page, change workspace settings, or manage members. anything not shared with the integration in notion is invisible to it, and turning a capability group off in the room removes those tools from the agents immediately, with no reconnect needed.

## faq

### can an ai agent write pages in notion?

yes, with the create and edit content scope. notion_create_pages creates one or many under a page or data source parent, and notion_update_page changes properties, icon, cover, or the markdown content itself. both are mutating tools and ask before they run.

### what does the notion integration actually see?

only the pages and data sources shared with the integration in notion. that sharing boundary is set in notion, not in aldena, so the smallest safe start is to share one workspace section and widen it once you can see what the agents do with it.

### can agents query a database rather than reading pages one by one?

yes. notion_query_data_sources runs filters and sorts over a data source's rows, and notion_query_view runs a view's own stored filters and sorts. that means an agent reads your board the way your team sees it instead of reconstructing the query itself.

### can an agent change a database schema?

notion_update_data_source renames a data source or changes its property schema, and notion_create_database creates a new one. those sit behind the create and edit content scope and stop for approval, because a property rename is felt by everything that reads the database.

### can it comment instead of editing?

yes, and that is often the better default. post comments is its own scope, so a room can let agents reply on a page or a discussion thread through notion_create_comment while leaving page content entirely read only.
