UNPKG

@cyanheads/pubmed-mcp-server

Version:

A Model Context Protocol (MCP) server enabling AI agents to intelligently search, retrieve, and analyze biomedical literature from PubMed via NCBI E-utilities. Built on the mcp-ts-template for robust, production-ready performance.

39 lines (38 loc) 2.09 kB
/** * @fileoverview Main logic handler for the 'get_pubmed_article_connections' MCP tool. * Orchestrates calls to ELink or citation formatting handlers. * @module src/mcp-server/tools/getPubMedArticleConnections/logic/index */ import { z } from "zod"; import { RequestContext } from "../../../../utils/index.js"; import type { ToolOutputData } from "./types.js"; /** * Zod schema for the input parameters of the 'get_pubmed_article_connections' tool. */ export declare const GetPubMedArticleConnectionsInputSchema: z.ZodObject<{ sourcePmid: z.ZodString; relationshipType: z.ZodDefault<z.ZodEnum<["pubmed_similar_articles", "pubmed_citedin", "pubmed_references", "citation_formats"]>>; maxRelatedResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; citationStyles: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["ris", "bibtex", "apa_string", "mla_string"]>, "many">>>; }, "strip", z.ZodTypeAny, { sourcePmid: string; relationshipType: "pubmed_similar_articles" | "pubmed_citedin" | "pubmed_references" | "citation_formats"; maxRelatedResults: number; citationStyles: ("ris" | "bibtex" | "apa_string" | "mla_string")[]; }, { sourcePmid: string; relationshipType?: "pubmed_similar_articles" | "pubmed_citedin" | "pubmed_references" | "citation_formats" | undefined; maxRelatedResults?: number | undefined; citationStyles?: ("ris" | "bibtex" | "apa_string" | "mla_string")[] | undefined; }>; /** * Type alias for the validated input of the 'get_pubmed_article_connections' tool. */ export type GetPubMedArticleConnectionsInput = z.infer<typeof GetPubMedArticleConnectionsInputSchema>; /** * Main handler for the 'get_pubmed_article_connections' tool. * @param {GetPubMedArticleConnectionsInput} input - Validated input parameters. * @param {RequestContext} context - The request context for this tool invocation. * @returns {Promise<ToolOutputData>} The result of the tool call. */ export declare function handleGetPubMedArticleConnections(input: GetPubMedArticleConnectionsInput, context: RequestContext): Promise<ToolOutputData>;