I built the **Dropbox Tool** to give Open WebUI agents access to the file system. This allows the AI to read notes, manage files, and save data directly to Dropbox.
> [!NOTE] Get the Tool
> You can install this tool directly from the Open WebUI registry: [Dropbox Tool for Open WebUI](https://openwebui.com/t/w_hogben/dropbox_tool)
## The Context
Most Open WebUI setups are isolated from your files. You have to upload documents into the file manager, and the AI cannot save its output permanently.
My notes live in **Obsidian**, which syncs via Dropbox. I wanted my AI agents to access this data directly, without manual uploads.
## The Solution
This tool gives Open WebUI agents CRUD (Create, Read, Update, Delete) access to Dropbox.
### Key Capabilities
* **File Operations**: The agent can list directories, move files, create folders, and delete items.
* **Search**: It can search for files by name or content.
* **Logging**: The `append_text` function allows the AI to add lines to a file, which is useful for maintaining logs or journals.
### Technical Implementation
The tool handles **OAuth2** for multiple users.
1. **Multi-User Security**: Each user authenticates with their own Dropbox account. The tool manages the OAuth flow and stores tokens locally.
2. **Auth Handling**: It automatically handles access token expiration and refreshing.
Here is how the tool handles appending text. It checks if the file exists and creates it if necessary:
```python
def append_text(self, path, text, __user__):
# ... auth checks ...
try:
# Try to download existing content
_, res = dbx.files_download(path)
existing_content = res.content.decode("utf-8")
new_content = existing_content + text
dbx.files_upload(new_content.encode("utf-8"), path, mode=dropbox_sdk.files.WriteMode("overwrite"))
except dropbox_sdk.exceptions.ApiError as err:
# If file doesn't exist, create it
if err.error.is_path() and err.error.get_path().is_not_found():
dbx.files_upload(text.encode("utf-8"), path, mode=dropbox_sdk.files.WriteMode("add"))
```
## Example Usage
### 1. Searching Notes
**User:** "Find my notes on 'Robogame' and summarize the key points."
**Agent:**
1. Calls `search(query="Robogame", path="/obsidian_vault")`.
2. Identifies the file: `/obsidian_vault/robogame/Robogame Design Notes.md`.
3. Calls `read_text(path="/obsidian_vault/robogame/Robogame Design Notes.md")`.
4. Reads the content and generates a summary.
### 2. Logging
**User:** "Log that I finished the Dropbox integration feature today."
**Agent:**
1. Calls `append_text(path="/_working_notes/daily_log.md", text="\n- Finished Dropbox integration feature")`.
2. The note updates in the background.
## Getting Started
To use this tool, create a Dropbox App:
1. Go to the [Dropbox Developers App Console](https://www.dropbox.com/developers/apps).
2. Create an app (App folder or Full Dropbox).
3. Generate your **App Key** and **App Secret**.
4. Enter these credentials in the Tool's "Valves" settings in Open WebUI.
Once configured, the AI will provide an authorization link on first use.