save_literature_notes
Persist selected PubMed articles as structured local wiki, Foam, Markdown, or MedPaper notes, with optional abstracts, index files, and CSL JSON export.
Instructions
Save searched articles as guided local wiki/Foam/Markdown notes.
When to Use
After unified_search, persist the selected literature into a local note library.
Give agents a structured alternative to generic write_file calls.
Create wiki notes with Foam-compatible wikilinks, MedPaper-like reference notes, and frontmatter.
Use stable wiki/Foam link targets and return wiki_validation for unresolved-link checks.
Local Directory Resolution
output_dir argument, if provided
PUBMED_NOTES_DIR environment variable
PUBMED_WORKSPACE_DIR/references
PUBMED_DATA_DIR/references
Authenticated Service Boundary
Remote authenticated callers cannot choose output_dir or template_file. Their notes always go to references/ under the current tenant's installed SessionManager data root; process-wide notes/workspace environment paths are intentionally ignored.
Args: pmids: Articles to save. Accepts "last", delimited PMID text, a string array, or a JSON array string. output_dir: Optional target folder for notes. note_format: "wiki" (default, Foam-compatible), "foam", "markdown", or "medpaper". include_abstract: Include abstracts in article notes. overwrite: Overwrite existing per-article notes when filenames collide. create_index: Create a collection index note linking saved articles. collection_name: Optional title/file stem for the index note. template_file: Optional Markdown template with placeholders like {title}, {pmid}, {citation_key}. include_csl_json: Write references.csl.json beside notes for citation-manager handoff.
Returns: JSON with written/skipped files, index information, and wiki_validation. Local callers receive filesystem paths. Authenticated callers receive tenant-relative logical locators and never receive server host paths.
Examples: save_literature_notes(pmids="last") save_literature_notes(pmids="last", note_format="medpaper", output_dir="./references") save_literature_notes(pmids="12345678,87654321", template_file="./ref-template.md")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pmids | No | last | |
| overwrite | No | ||
| output_dir | No | ||
| note_format | No | wiki | |
| create_index | No | ||
| template_file | No | ||
| collection_name | No | ||
| include_abstract | No | ||
| include_csl_json | No |