@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.
23 lines (22 loc) • 1.2 kB
JavaScript
/**
* @fileoverview Core logic invocation for the pubmed_research_agent tool.
* This tool generates a structured research plan outline with instructive placeholders,
* designed to be completed by a calling LLM (the MCP Client).
* @module pubmedResearchAgent/logic
*/
import { logger, requestContextService, sanitizeInputForLogging, } from "../../../utils/index.js";
import { generateFullResearchPlanOutline, } from "./logic/index.js";
export async function pubmedResearchAgentLogic(input, parentRequestContext) {
const operationContext = requestContextService.createRequestContext({
parentRequestId: parentRequestContext.requestId,
operation: "pubmedResearchAgentLogicExecution",
input: sanitizeInputForLogging(input),
});
logger.info(`Executing 'pubmed_research_agent' to generate research plan outline. Keywords: ${input.research_keywords.join(", ")}`, operationContext);
const researchPlanOutline = generateFullResearchPlanOutline(input, operationContext);
logger.notice("Successfully generated research plan outline.", {
...operationContext,
projectTitle: input.project_title_suggestion,
});
return researchPlanOutline;
}