Skip to main content
Glama

save_literature_notes

Destructive

Persist selected PubMed articles as structured local wiki, Foam, or Markdown notes with wikilinks and frontmatter for your research library.

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

  1. output_dir argument, if provided

  2. PUBMED_NOTES_DIR environment variable

  3. PUBMED_WORKSPACE_DIR/references

  4. 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", a PMID string, or a JSON array of PMID strings. 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

TableJSON Schema
NameRequiredDescriptionDefault
pmidsNolast
overwriteNo
output_dirNo
note_formatNowiki
create_indexNo
template_fileNo
collection_nameNo
include_abstractNo
include_csl_jsonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.7.2
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / collection_name / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 200,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / note_format / enum
      Added value: +[
      +  "wiki",
      +  "foam",
      +  "markdown",
      +  "medpaper"
      +]
    • changedInput schema / properties / output_dir / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 4096,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / pmids / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "items": {},
      -    "type": "array"
      -  },
      -  {
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 100000,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "maxLength": 512,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 1000,
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / template_file / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 4096,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "save_literature_notesOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.5.16

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare destructiveHint=true, idempotentHint=false and openWorldHint=true, and the description meaningfully extends this: it discloses the environment-variable resolution order, the tenant-isolation rule for authenticated callers (output_dir/template_file ignored), and that host paths are never leaked. That is context beyond what the annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the directive and well-sectioned under When to Use / Directory Resolution / Service Boundary / Args / Returns / Examples. The Args list is long but each entry earns its place; only minor trimming is possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 9 parameters, no output schema, and zero schema coverage, this description still supplies the write semantics, directory resolution, auth-boundary caveat, and an explicit Returns description including the wiki_validation output. Nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden for 9 params, and it does: pmids accepts 'last'/a string/JSON array, note_format's four values are explained, template_file placeholders are named, and include_csl_json's purpose (citation-manager handoff) is stated. Every parameter gets meaning the bare schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Save searched articles as ... wiki/Foam/Markdown notes') and immediately positions itself against siblings by calling out unified_search as the upstream and framing itself as 'a structured alternative to generic write_file calls'. An agent can identify the tool's role without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes an explicit 'When to Use' section that sequences it after unified_search and names the alternatives it replaces. The Local Directory Resolution ordering and the Authenticated Service Boundary section add conditional guidance that decides how the tool behaves in different deployment contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.