UNPKG

@cyanheads/pubmed-mcp-server

Version:

Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms via MCP. STDIO or Streamable HTTP.

59 lines 1.94 kB
/** * @fileoverview Hand-rolled citation formatters for PubMed articles. * Supports APA 7th, MLA 9th, BibTeX, and RIS formats. * Pure TypeScript, zero dependencies, Workers-compatible. * @module src/services/ncbi/formatting/citation-formatter */ import type { ParsedArticle } from '../types.js'; /** Supported citation output formats. */ export type CitationStyle = 'apa' | 'mla' | 'bibtex' | 'ris'; /** * Format a PubMed article as an APA 7th edition citation. * * Pattern: * ``` * Authors (Year). Title. *Journal*, *Volume*(Issue), Pages. https://doi.org/DOI * ``` */ export declare function formatApa(article: ParsedArticle): string; /** * Format a PubMed article as an MLA 9th edition citation. * * Pattern: * ``` * Last, First, et al. "Title." *Journal*, vol. 12, no. 3, 2024, pp. 45-67. DOI. * ``` */ export declare function formatMla(article: ParsedArticle): string; /** * Format a PubMed article as a BibTeX entry. * * ```bibtex * @article{pmid12345678, * author = {Last, First and Last, First}, * title = {Article Title}, * journal = {Journal Name}, * year = {2024}, * ... * } * ``` */ export declare function formatBibtex(article: ParsedArticle): string; /** * Format a PubMed article as a RIS record. * * Each tag is 2 characters, followed by two spaces, a dash, two spaces, then the value. * Record ends with `ER - ` (trailing spaces per spec). */ export declare function formatRis(article: ParsedArticle): string; /** * Format a single article in the requested citation style. * Throws on unsupported style. */ export declare function formatCitation(article: ParsedArticle, style: CitationStyle): string; /** * Format a single article in multiple citation styles. * Returns a record keyed by style name. */ export declare function formatCitations(article: ParsedArticle, styles: CitationStyle[]): Record<string, string>; //# sourceMappingURL=citation-formatter.d.ts.map