fetch_paper
Retrieve academic papers by DOI, URL, or title, returning full-text Markdown with metadata and embedded figures for AI consumption.
Instructions
Fetch AI-friendly paper content. Returns a fixed FetchEnvelope-style object with top-level provenance, token_estimate_breakdown={abstract,body,refs}, and optional article/markdown/metadata payloads. The MCP tool also publishes an output schema for clients that support structured result validation. Tool JSON payloads include schema_version=1; error payloads retain status/reason and add machine-readable code, http_status, error_category, retry_after_seconds, provider, warnings, and source_trail. Defaults: modes=['article','markdown'], strategy.asset_profile omitted (provider default), strategy.allow_metadata_only_fallback=true, include_refs=null, max_tokens='full_text', prefer_cache=false, no_download=false, artifact_mode='markdown-assets', save_markdown=false, markdown_output_dir=null, markdown_filename=null. Set prefer_cache=true to resolve the query to a DOI, then try a matching local cached FetchEnvelope sidecar before running the full fetch waterfall. Use artifact_mode='none' to disable provider artifacts and assets while keeping MCP fetch-envelope cache sidecars. Use no_download=true to avoid writing provider payloads, PDFs, HTML, assets, and fetch-envelope sidecars. Set save_markdown=true to write the rendered Markdown full text to disk; successful saves return saved_markdown_path, while metadata-only or abstract-only results add a warning and download:markdown_skipped_no_fulltext. Use strategy.asset_profile='none', 'body', or 'all' to control local asset downloads; 'none' does not remove remote image links already present in rendered Markdown. With body/all profiles, key local figures may be returned as ImageContent alongside the JSON result; strategy.inline_image_budget can override the default caps of 3 figures, 2 MiB each, and 8 MiB total, and any resulting zero disables inline images. provider_hint and preferred_providers accept the runtime provider catalog (crossref, elsevier, springer, wiley, science, pnas, ieee, arxiv, copernicus, ams, mdpi, royalsocietypublishing, annualreviews, plos, oxfordacademic, acs, iop, aip, frontiers). Browser runtime providers are catalog-derived from ProviderSpec.requires_browser_runtime=True (wiley, science, pnas, mdpi, royalsocietypublishing, annualreviews, acs, iop, aip). Public article sources are catalog-derived from SOURCE_PROVIDER_MAP: acs->acs, aip_html->aip, aip_pdf->aip, ams_html->ams, ams_pdf->ams, annualreviews_html->annualreviews, annualreviews_pdf->annualreviews, arxiv_html->arxiv, arxiv_pdf->arxiv, copernicus_pdf->copernicus, copernicus_xml->copernicus, crossref_meta->crossref, elsevier_pdf->elsevier, elsevier_xml->elsevier, frontiers_pdf->frontiers, frontiers_xml->frontiers, ieee_html->ieee, ieee_pdf->ieee, iop_html->iop, iop_pdf->iop, mdpi_html->mdpi, mdpi_pdf->mdpi, oxfordacademic_html->oxfordacademic, oxfordacademic_pdf->oxfordacademic, plos_pdf->plos, plos_xml->plos, pnas->pnas, royalsocietypublishing_html->royalsocietypublishing, royalsocietypublishing_pdf->royalsocietypublishing, science->science, springer_html->springer, springer_pdf->springer, wiley_browser->wiley. elsevier keeps an official XML route and may fall back to the official Elsevier API PDF lane before degrading to metadata-only, publishing elsevier_xml on XML success and elsevier_pdf on PDF fallback success. springer uses provider-managed direct HTML and direct HTTP PDF fallback, publishing springer_html or springer_pdf. wiley keeps CDP browser HTML first, then CDP browser-seeded publisher PDF/ePDF fallback, and may still continue into the official Wiley TDM API PDF lane when WILEY_TDM_CLIENT_TOKEN is configured while publishing source wiley_browser on success. science, pnas, annualreviews, royalsocietypublishing, acs, iop, aip, and mdpi routes use provider-managed browser runtime HTML plus seeded-browser publisher PDF/ePDF repo-local workflows; AMS uses direct HTTP HTML with direct HTTP PDF fallback, publishes ams_html or ams_pdf, and does not request citation_xml_url / /doc/...xml; Annual Reviews publishes annualreviews_html or annualreviews_pdf; Royal Society Publishing publishes royalsocietypublishing_html or royalsocietypublishing_pdf and does not use citation_xml_url as an XML route; ACS publishes acs; IOP publishes iop_html or iop_pdf, rejects Radware/hCaptcha challenge pages, and does not implement unauthenticated TDM XML/PDF; AIP publishes aip_html or aip_pdf; MDPI publishes mdpi_html or mdpi_pdf and does not use an XML route. ieee uses landing metadata, the Xplore dynamic HTML endpoint, and direct HTTP PDF fallback while publishing ieee_html or ieee_pdf. arxiv uses ID-derived official HTML first, optional API/HTML metadata merge, and PDF fallback while publishing arxiv_html or arxiv_pdf. copernicus uses direct HTTP landing discovery, public NLM/JATS XML, and PDF fallback before metadata fallback while publishing copernicus_xml or copernicus_pdf; it does not need browser runtime or credentials. royalsocietypublishing uses CDP browser DOI HTML with CDP browser-seeded PDF fallback while publishing royalsocietypublishing_html or royalsocietypublishing_pdf. plos uses public JATS XML with direct HTTP PDF fallback while publishing plos_xml or plos_pdf. frontiers discovers canonical Frontiers article routes from landing HTML, then uses public JATS XML with direct HTTP PDF fallback while publishing frontiers_xml or frontiers_pdf. oxfordacademic uses direct HTTP article HTML with direct HTTP PDF fallback while publishing oxfordacademic_html or oxfordacademic_pdf. PDF fallback saves exported PDF images for body/all requests when artifact saving is enabled. On successful HTML/XML routes, asset_profile='none' disables local asset downloads but keeps rendered remote Markdown image links when the provider can resolve them. asset_profile='body' means provider-cleaned body figure/table/formula assets only, while asset_profile='all' additionally downloads supplementary files; supplementary files are saved as assets but are not emitted as ImageContent. Wiley/Science/PNAS/Annual Reviews/Royal Society Publishing/ACS/IOP/AIP/MDPI support body/all assets on successful CDP browser HTML routes and share the PDF/ePDF fallback image export behavior with Springer/IEEE/arXiv/Copernicus. Set download_dir to isolate task-local downloads; the MCP server can also surface scoped cache resources for that directory during the current session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modes | No | ||
| query | Yes | ||
| strategy | No | ||
| max_tokens | No | full_text | |
| no_download | No | ||
| download_dir | No | ||
| include_refs | No | ||
| prefer_cache | No | ||
| artifact_mode | No | markdown-assets | |
| save_markdown | No | ||
| markdown_filename | No | ||
| markdown_output_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doi | No | ||
| code | No | ||
| trace | No | ||
| reason | No | ||
| source | No | ||
| status | No | ||
| article | No | ||
| quality | No | ||
| markdown | No | ||
| metadata | No | ||
| provider | No | ||
| warnings | No | ||
| candidates | No | ||
| http_status | No | ||
| missing_env | No | ||
| content_kind | No | ||
| has_abstract | No | ||
| has_fulltext | No | ||
| source_trail | No | ||
| error_category | No | ||
| schema_version | No | ||
| token_estimate | No | ||
| retry_after_seconds | No | ||
| saved_markdown_path | No | ||
| token_estimate_breakdown | No |