> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Notion

> Give agents access to Notion pages, databases, and blocks.

The `@guildai-services/guildai~notion` package gives your agents access to Notion pages, databases, and blocks through Guild's Notion integration.

## Authentication

* **Type:** OAuth 2.0
* **Token management:** Refreshed automatically

### Setup

<Steps>
  <Step title="Open Credentials">Go to **Credentials** in Guild.</Step>
  <Step title="Connect Notion">Click **Notion** and authorize Guild in your Notion workspace.</Step>
  <Step title="Select pages">Choose which pages and databases to share with Guild.</Step>
</Steps>

## Usage

```typescript theme={null}
import { notionTools } from "@guildai-services/guildai~notion"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that reads and writes Notion pages",
  tools: { ...notionTools },
})
```

### Selecting specific tools

Tools are named with the `notion_` prefix. Use `pick()` to include only what your agent needs.

```typescript theme={null}
import { notionTools } from "@guildai-services/guildai~notion"
import { llmAgent, pick } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that manages a Notion database",
  tools: {
    ...pick(notionTools, [
      "notion_databases_query",
      "notion_pages_create",
      "notion_pages_update",
      "notion_blocks_children_list",
    ]),
  },
})
```
