Skip to main content
Glama

save_literature_notes

Destructive

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

  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", 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

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. Changed13 schema fields changedv0.7.7
    • addedInput schema / properties / create_index / anyOf
      Added value: +[
      +  {
      +    "default": true,
      +    "title": "Create Index",
      +    "type": "boolean"
      +  },
      +  {
      +    "description": "Explicit true/false text, ignoring ASCII case and surrounding whitespace.",
      +    "pattern": "^[ \\t\\r\\n]*(?:[tT][rR][uU][eE]|[fF][aA][lL][sS][eE])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / create_index / type
      Removed value: -"boolean"
    • addedInput schema / properties / include_abstract / anyOf
      Added value: +[
      +  {
      +    "default": true,
      +    "title": "Include Abstract",
      +    "type": "boolean"
      +  },
      +  {
      +    "description": "Explicit true/false text, ignoring ASCII case and surrounding whitespace.",
      +    "pattern": "^[ \\t\\r\\n]*(?:[tT][rR][uU][eE]|[fF][aA][lL][sS][eE])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / include_abstract / type
      Removed value: -"boolean"
    • addedInput schema / properties / include_csl_json / anyOf
      Added value: +[
      +  {
      +    "default": true,
      +    "title": "Include Csl Json",
      +    "type": "boolean"
      +  },
      +  {
      +    "description": "Explicit true/false text, ignoring ASCII case and surrounding whitespace.",
      +    "pattern": "^[ \\t\\r\\n]*(?:[tT][rR][uU][eE]|[fF][aA][lL][sS][eE])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / include_csl_json / type
      Removed value: -"boolean"
    • addedInput schema / properties / note_format / anyOf
      Added value: +[
      +  {
      +    "default": "wiki",
      +    "enum": [
      +      "wiki",
      +      "foam",
      +      "markdown",
      +      "medpaper"
      +    ],
      +    "title": "Note Format",
      +    "type": "string"
      +  },
      +  {
      +    "pattern": "^[ \\t\\r\\n]*(?:[wW][iI][kK][iI]|[fF][oO][aA][mM]|[mM][aA][rR][kK][dD][oO][wW][nN]|[mM][eE][dD][pP][aA][pP][eE][rR])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / note_format / enum
      Removed value: -[
      -  "wiki",
      -  "foam",
      -  "markdown",
      -  "medpaper"
      -]
    • removedInput schema / properties / note_format / type
      Removed value: -"string"
    • addedInput schema / properties / overwrite / anyOf
      Added value: +[
      +  {
      +    "default": false,
      +    "title": "Overwrite",
      +    "type": "boolean"
      +  },
      +  {
      +    "description": "Explicit true/false text, ignoring ASCII case and surrounding whitespace.",
      +    "pattern": "^[ \\t\\r\\n]*(?:[tT][rR][uU][eE]|[fF][aA][lL][sS][eE])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / overwrite / type
      Removed value: -"boolean"
    • changedInput schema / properties / pmids / anyOf
      Previous value: -[
      -  {
      -    "maxLength": 100000,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "maxLength": 512,
      -      "minLength": 1,
      -      "type": "string"
      -    },
      -    "maxItems": 1000,
      -    "minItems": 1,
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "description": "Complete PMID(s): delimited text, JSON string array, or Markdown list; optional JSON code fence. last only where supported.",
      +    "examples": [
      +      "33053718,36170657",
      +      "[\"33053718\",\"36170657\"]",
      +      "- 33053718\n- 36170657"
      +    ],
      +    "format": "pubmed-pmid-batch",
      +    "maxLength": 100000,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "description": "One PMID string, or last as the sole batch item for tools supporting session reuse.",
      +      "examples": [
      +        "33053718"
      +      ],
      +      "format": "pubmed-pmid",
      +      "maxLength": 512,
      +      "minLength": 1,
      +      "type": "string",
      +      "x-pubmed-input": "pmid"
      +    },
      +    "maxItems": 1000,
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • addedInput schema / properties / pmids / x-pubmed-input
      Added value: +"pmid_batch"
  2. 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
  3. First observedv0.5.16

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and openWorldHint=true, and the description goes well beyond that: it discloses the four-step directory resolution order, the authenticated-service boundary where remote callers cannot set output_dir/template_file and env paths are ignored, and the filename-collision overwrite semantics. These are non-obvious behaviors an agent could not infer from the schema.

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?

Headings (When to Use, Local Directory Resolution, Authenticated Service Boundary, Args, Returns, Examples) make it easy to scan and the critical scoping info is front-loaded. It runs somewhat long and repeats the format list in both prose and Args, but nearly every line carries actionable information.

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?

For a 9-parameter mutation tool with no output schema, the description covers destination resolution, tenant/auth constraints, overwrite behavior, and even the return shape (written/skipped files, index info, wiki_validation, path vs. logical locator). An agent has everything needed to call it correctly in both local and authenticated contexts.

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

Parameters4/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 burden and largely does: the Args block defines all nine parameters, explains note_format semantics ('wiki' default, Foam-compatible), and gives template placeholder examples ({title}, {pmid}, {citation_key}). A few entries remain thin (output_dir is only 'Optional target folder'), but overall it compensates well for the empty schema descriptions.

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+resource+output artifact: 'Save searched articles as guided local wiki/Foam/Markdown notes.' It immediately distinguishes itself from siblings like prepare_export and generic write_file, and the note_format vocabulary (wiki/foam/markdown/medpaper) tells an agent exactly what this produces.

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?

The 'When to Use' block gives explicit sequencing ('After unified_search, persist the selected literature') and names the alternative it replaces ('a structured alternative to generic write_file calls'). It also states the specific capability (Foam wikilinks, wiki_validation) that selects this tool over a plain file write.

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