Skip to main content
Glama

prepare_export

Export PubMed citations to RIS, BibTeX, CSL, MEDLINE, CSV, or JSON for EndNote, Zotero, Mendeley, LaTeX, and data analysis.

Instructions

Export citations to reference manager formats.

╔═══════════════════════════════════════════════════════════════════╗ ║ RECOMMENDED: Use source="official" (default) for best quality ║ ╚═══════════════════════════════════════════════════════════════════╝

When to Use

  • Exporting references to EndNote, Zotero, Mendeley

  • Creating BibTeX for LaTeX documents

  • Generating citation lists for manuscripts

Source Options

Source

Formats

Quality

Speed

official

ris, medline, csl

★★★★★

Fast

local

ris, bibtex, csv, medline, json

★★★★

Fast

Format Selection Guide

  • ris: EndNote, Zotero, Mendeley (official recommended)

  • medline: NBIB format for PubMed tools

  • csl: JSON for programmatic citation styling

  • bibtex: LaTeX documents (local only)

  • csv: Data analysis, Excel (local only)

Args: pmids: Articles to export. Accepts: - "last" → results from previous search - "12345678,87654321" → comma-separated PMIDs - ["12345678", "87654321"] → list of PMIDs - '["12345678", "87654321"]' → JSON array string - "PMID:12345678" → with prefix format: Export format (default: "ris") - official API: ris, medline, csl - local only: bibtex, csv, json include_abstract: Include abstracts in output (default: True). False requires source="local"; official payloads are returned unmodified. source: Citation source (default: "official") - "official": NCBI Citation API (recommended, best quality) - "local": Local formatting (more formats, offline capable)

Returns: JSON with status and export_text containing formatted citations.

Examples: # Export last search results (recommended) prepare_export(pmids="last", format="ris")

# Export specific PMIDs to BibTeX
prepare_export(pmids="12345678,87654321", format="bibtex", source="local")

# Get CSL-JSON for programmatic use
prepare_export(pmids="last", format="csl", source="official")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidsYes
formatNoris
sourceNoofficial
include_abstractNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.7.7
    • addedInput schema / properties / format / anyOf
      Added value: +[
      +  {
      +    "default": "ris",
      +    "enum": [
      +      "ris",
      +      "medline",
      +      "csl",
      +      "bibtex",
      +      "csv",
      +      "json"
      +    ],
      +    "title": "Format",
      +    "type": "string"
      +  },
      +  {
      +    "pattern": "^[ \\t\\r\\n]*(?:[rR][iI][sS]|[mM][eE][dD][lL][iI][nN][eE]|[cC][sS][lL]|[bB][iI][bB][tT][eE][xX]|[cC][sS][vV]|[jJ][sS][oO][nN])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / format / enum
      Removed value: -[
      -  "ris",
      -  "medline",
      -  "csl",
      -  "bibtex",
      -  "csv",
      -  "json"
      -]
    • removedInput schema / properties / format / type
      Removed value: -"string"
    • 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"
    • 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"
    • addedInput schema / properties / source / anyOf
      Added value: +[
      +  {
      +    "default": "official",
      +    "enum": [
      +      "official",
      +      "local"
      +    ],
      +    "title": "Source",
      +    "type": "string"
      +  },
      +  {
      +    "pattern": "^[ \\t\\r\\n]*(?:[oO][fF][fF][iI][cC][iI][aA][lL]|[lL][oO][cC][aA][lL])[ \\t\\r\\n]*$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / source / enum
      Removed value: -[
      -  "official",
      -  "local"
      -]
    • removedInput schema / properties / source / type
      Removed value: -"string"
  2. Changed5 schema fields changedv0.7.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / format / enum
      Added value: +[
      +  "ris",
      +  "medline",
      +  "csl",
      +  "bibtex",
      +  "csv",
      +  "json"
      +]
    • 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"
      +  }
      +]
    • addedInput schema / properties / source / enum
      Added value: +[
      +  "official",
      +  "local"
      +]
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "prepare_exportOutput",
      -  "type": "object"
      -}New value: +null
  3. First observedv0.5.16

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare a non-read-only, open-world, non-idempotent operation, and the description adds real behavioral context beyond them: include_abstract=False requires source='local' because official payloads are returned unmodified, local is offline capable, and the return shape is status + export_text. It stops short of explaining latency, rate limits, or side effects that justify readOnlyHint=false.

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?

Well front-loaded with the recommended-default callout, then organized into scannable sections (When to Use, Source Options, Format Selection) and ended with runnable examples. It is long, and the box-drawing banner is decorative overhead, 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 4-parameter tool with no output schema, the description covers input formats, defaults, valid parameter combinations, offline vs API behavior, and the return payload shape. Nothing an agent needs in order 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 reported as 0%, so the description carries the full burden and does so thoroughly: accepted pmids encodings (last, comma-separated, list, JSON array string, PMID: prefix), the meaning of each format enum value, the include_abstract default and its source constraint, and the source trade-offs. This is exactly the compensation the low schema coverage requires.

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 ('Export citations to reference manager formats') up front, and the format/source tables make clear it produces formatted citation text rather than fetching or analyzing records. An agent can distinguish it from get_citation_metrics or fetch_article_details without opening 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?

Explicit 'When to Use' list names the concrete scenarios (EndNote/Zotero/Mendeley, BibTeX for LaTeX, manuscript citation lists), and the source/format tables give guidance on which option to pick and when. It also flags a hard constraint (bibtex/csv/json require source='local') so the agent can avoid invalid combinations.

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