Skip to content

Commit bdabba2

Browse files
authored
Add docs for new Notion tool (#356)
Add docs for Notion tool
1 parent 1e451a3 commit bdabba2

3 files changed

Lines changed: 89 additions & 1 deletion

File tree

pages/toolkits/productivity/notion.mdx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ These tools are currently available in the Arcade Notion toolkit.
3838
["NotionToolkit.SearchByTitle", "Search for pages or databases by title."],
3939
["NotionToolkit.GetObjectMetadata", "Get the metadata of a Notion object (page or database) using its title or ID."],
4040
["NotionToolkit.GetWorkspaceStructure", "Get the complete workspace structure of your Notion workspace."],
41+
["NotionToolkit.AppendContentToEndOfPage", "Append content to the end of a Notion page."],
4142
]}
4243
/>
4344

@@ -213,6 +214,32 @@ Get the complete workspace structure of your Notion workspace. This tool returns
213214

214215
_None_
215216

217+
---
218+
219+
## NotionToolkit.AppendContentToEndOfPage
220+
221+
<br />
222+
<TabbedCodeBlock
223+
tabs={[
224+
{
225+
label: "Call the tool with user authorization",
226+
content: {
227+
Python: [
228+
"/examples/integrations/toolkits/notion/append_content_to_end_of_page.py",
229+
],
230+
JavaScript: ["/examples/integrations/toolkits/notion/append_content_to_end_of_page.js"],
231+
},
232+
}
233+
]}
234+
/>
235+
236+
Append markdown content to the end of a Notion page using either the page's ID or title.
237+
238+
**Parameters**
239+
240+
- **`page_id_or_title`** _(string, required)_ The ID or title of the page to append content to.
241+
- **`content`** _(string, required)_ The markdown content to append to the end of the page.
242+
216243
## Auth
217244

218245
The Arcade Notion toolkit uses the [Notion auth provider](/home/auth-providers/notion) to connect to users' Notion accounts.
@@ -221,4 +248,4 @@ With the hosted Arcade Engine, there's nothing to configure. Your users will see
221248

222249
With a self-hosted installation of Arcade, you need to [configure the Notion auth provider](/home/auth-providers/notion#configuring-notion-auth) with your own Notion app credentials.
223250

224-
<ToolFooter pipPackageName="arcade_notion_toolkit" />
251+
<ToolFooter pipPackageName="arcade_notion_toolkit" />
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Arcade } from "@arcadeai/arcadejs";
2+
3+
const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
const USER_ID = "{arcade_user_id}";
6+
const TOOL_NAME = "NotionToolkit.AppendContentToEndOfPage";
7+
8+
// Start the authorization process
9+
const authResponse = await client.tools.authorize({
10+
tool_name: TOOL_NAME,
11+
user_id: USER_ID,
12+
});
13+
14+
if (authResponse.status !== "completed") {
15+
console.log(`Click this link to authorize: ${authResponse.url}`);
16+
}
17+
18+
// Wait for the authorization to complete
19+
await client.auth.waitForCompletion(authResponse);
20+
21+
const toolInput = {
22+
page_id_or_title: "YOUR_PAGE_ID_OR_TITLE",
23+
content: "P.S. Never forget that you are a wizard."
24+
};
25+
26+
const response = await client.tools.execute({
27+
tool_name: TOOL_NAME,
28+
input: toolInput,
29+
user_id: USER_ID,
30+
});
31+
32+
console.log(response);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from arcadepy import Arcade
2+
3+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
USER_ID = "{arcade_user_id}"
6+
TOOL_NAME = "NotionToolkit.AppendContentToEndOfPage"
7+
8+
auth_response = client.tools.authorize(
9+
tool_name=TOOL_NAME,
10+
user_id=USER_ID,
11+
)
12+
13+
if auth_response.status != "completed":
14+
print(f"Click this link to authorize: {auth_response.url}")
15+
16+
# Wait for the authorization to complete
17+
client.auth.wait_for_completion(auth_response)
18+
19+
tool_input = {
20+
"page_id_or_title": "YOUR_PAGE_ID_OR_TITLE",
21+
"content": "P.S. Never forget that you are a wizard."
22+
}
23+
24+
response = client.tools.execute(
25+
tool_name=TOOL_NAME,
26+
input=tool_input,
27+
user_id=USER_ID,
28+
)
29+
print(response)

0 commit comments

Comments
 (0)