Notion in Agent Workspace: from page search to an approved update
Today I continued testing Agent Workspace, built with Laravel, the Laravel AI SDK, and Composio. After Google Calendar, I moved to Notion.
I tested listing recently updated pages, retrieving page content, and appending text to an existing page.
The screenshots show two working paths:
1. “Get me the most recently updated 10 pages from Notion.” The agent returned page names and last-update times.
2. “Update the page ‘Tailwind’. Add the sentence ‘This is a test sentence’ at the bottom of the page.” The agent proposed a Notion block append and waited for approval. After approval, I checked the page directly in Notion. The sentence was there.
Getting there required more than connecting the account.
Schema validation exposed a PHP detail: an empty array is not the same as an empty JSON object. I adjusted validation to preserve that distinction where the tool schema requires an object. Notion responses also exposed nullable fields such as icon, cover, and public_url that needed correct handling.
Retrieving page content needed attention, too. Searching for pages and reading a page are different actions. The returned block content also needed formatting into readable text.
The write test exposed another mismatch. The user asked to add a sentence to a page, but the execution guard did not recognize that request as permission for the underlying append-block action. The approval path needed to connect the user's intent to the concrete API operation.
The approval card shows the target block and the proposed paragraph. Approval covers only that action and those arguments.
The lesson: test the whole path from a plain-language request to the actual change in the external application. A successful chat response is not enough.
How do you verify that an agent changed the intended content, and nothing else?
#Laravel #LaravelAI #Notion #Composio #AIAgents #BuildInPublic