zotero_add_from_file
Add a local PDF or EPUB to Zotero, extracting metadata via DOI or filename fallback. Use when you have a file but no DOI or URL.
Instructions
Add an item to the active Zotero library from a LOCAL .pdf or .epub file. Attempts to extract the DOI from the file content; if found, enriches metadata via CrossRef (title, creators, journal, year, abstract). If no DOI is found, falls back to best-effort title/author guesses from the filename or document text. Use this when the user has a file on disk but no DOI/URL handy. If you have a DOI use zotero_add_by_doi; for an online URL use zotero_add_by_url. file_path: ABSOLUTE path to a .pdf or .epub file (relative paths fail). Other extensions are rejected. title: optional override if metadata extraction misses. collections: optional list of collection keys, names, or '/'-separated paths to file under — resolved and validated before the item is created. tags: optional list of tag strings. if_exists: 'duplicate' (default) | 'file' (when the extracted DOI matches an existing item, reuse it: file into missing collections, attach the file to it unless an attachment with the same filename exists) | 'skip' (no item, no attachment). create_missing_collections: create unknown collection specs. Requires a writable library (fails in local-only mode). PDF uploads may hit the 300MB Zotero cloud free-tier quota — metadata still lands. Run zotero_update_search_database afterwards for semantic search. Example: zotero_add_from_file(file_path='/Users/me/paper.pdf', collections=['9SU943GB']).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| title | No | ||
| item_type | No | document | |
| collections | No | ||
| tags | No | ||
| if_exists | No | duplicate | |
| create_missing_collections | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |