write_file
Write any file type into your Obsidian vault with atomic saves and optional overwrite. Supports base64 or text encoding for non-markdown content.
Instructions
Write a file into the vault — including non-markdown (e.g. save a
generated PDF or image). Requires a readwrite API key. Peer to
create_note/edit_note, which stay markdown-only.
content carries the bytes: with encoding="base64" (default) it is
base64-decoded to raw bytes; with encoding="text" it is written verbatim
as UTF-8. The write is atomic (tmp file + os.replace), missing parent
folders are created, and content over MAX_FILE_WRITE_BYTES (default
25 MB, decoded length) is refused.
No-clobber by default: writing over an existing file requires
overwrite=True. Dot-directories and path traversal are rejected; invalid
base64 errors without writing anything.
Args: path: Vault-relative destination path (e.g. "Outputs/report.pdf"). content: File contents — base64 string (default) or UTF-8 text. encoding: "base64" (default) or "text". overwrite: If True, replace an existing file. Off by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | ||
| encoding | No | base64 | |
| overwrite | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |