Zotero Attach File
zotero_attach_fileAttach a local file or direct PDF URL to an existing Zotero item as a child attachment, so you can add full text or supporting files to a reference already in your library.
Instructions
Attach a file to an EXISTING Zotero item as an imported child attachment (uploads the file bytes). Use when the item is already in the library and you have its key — e.g. attaching a PDF you found for a reference. To create a NEW item from a file, use zotero_add_item(source=) instead. item_key: key of the existing REGULAR item. Passing an attachment/note key fails with a hint to use its parent. file_path: ABSOLUTE local path (.pdf, .epub, .djvu, .doc, .docx, .odt, .rtf). url: direct http(s) link, downloaded server-side — PDF-only; for other formats download locally and use file_path. Exactly one of file_path/url must be given. filename: optional stored-filename override; defaults to the file's basename or the URL's last path segment (falling back to <item_key>.pdf); a missing extension is appended automatically. Returns the created attachment's key. Idempotent: if the item already has an attachment with the same filename or identical content (MD5), nothing is re-uploaded. Requires a writable library (fails in local-only mode). Uploads count against the Zotero cloud storage quota unless WebDAV sync is configured. Run zotero_update_search_database afterwards to index the new file for semantic search. link_mode: 'import' (default) uploads the file bytes; 'linked' records the absolute path only (like Zotero's 'Add Link to File') — the file is NOT moved or copied and no cloud quota is used. 'linked' requires file_path (not url) and a writable library; filename then only sets the title. Example: zotero_attach_file(item_key='ABCD2345', file_path='/Users/me/smith-2020.pdf').
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"item_key": "<item_key>"
},
"name": "zotero_attach_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| filename | No | ||
| item_key | Yes | ||
| file_path | No | ||
| link_mode | No | import |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |