@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.
110 lines • 4.74 kB
TypeScript
/**
* @fileoverview PubMed search tool. Searches PubMed with full query syntax,
* field-specific filters, date ranges, pagination, and optional brief summaries.
* @module src/mcp-server/tools/definitions/search-articles.tool
*/
import { z } from '@cyanheads/mcp-ts-core';
export declare const searchArticlesTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
query: z.ZodString;
maxResults: z.ZodDefault<z.ZodNumber>;
offset: z.ZodDefault<z.ZodNumber>;
sort: z.ZodDefault<z.ZodEnum<{
author: "author";
journal: "journal";
relevance: "relevance";
pub_date: "pub_date";
}>>;
dateRange: z.ZodOptional<z.ZodObject<{
minDate: z.ZodString;
maxDate: z.ZodString;
dateType: z.ZodDefault<z.ZodEnum<{
pdat: "pdat";
mdat: "mdat";
edat: "edat";
}>>;
}, z.core.$strip>>;
publicationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
author: z.ZodOptional<z.ZodString>;
journal: z.ZodOptional<z.ZodString>;
meshTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
language: z.ZodOptional<z.ZodString>;
hasAbstract: z.ZodOptional<z.ZodBoolean>;
freeFullText: z.ZodOptional<z.ZodBoolean>;
species: z.ZodOptional<z.ZodEnum<{
humans: "humans";
animals: "animals";
}>>;
summaryCount: z.ZodDefault<z.ZodNumber>;
}, z.core.$strip>, z.ZodObject<{
query: z.ZodString;
effectiveQuery: z.ZodString;
appliedFilters: z.ZodObject<{
dateRange: z.ZodOptional<z.ZodObject<{
minDate: z.ZodString;
maxDate: z.ZodString;
dateType: z.ZodEnum<{
pdat: "pdat";
mdat: "mdat";
edat: "edat";
}>;
}, z.core.$strip>>;
publicationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
author: z.ZodOptional<z.ZodString>;
journal: z.ZodOptional<z.ZodString>;
meshTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
language: z.ZodOptional<z.ZodString>;
hasAbstract: z.ZodOptional<z.ZodBoolean>;
freeFullText: z.ZodOptional<z.ZodBoolean>;
species: z.ZodOptional<z.ZodEnum<{
humans: "humans";
animals: "animals";
}>>;
}, z.core.$strip>;
totalFound: z.ZodNumber;
offset: z.ZodNumber;
pmids: z.ZodArray<z.ZodString>;
summaries: z.ZodArray<z.ZodObject<{
pmid: z.ZodString;
title: z.ZodOptional<z.ZodString>;
authors: z.ZodOptional<z.ZodString>;
source: z.ZodOptional<z.ZodString>;
pubDate: z.ZodOptional<z.ZodString>;
doi: z.ZodOptional<z.ZodString>;
pmcId: z.ZodOptional<z.ZodString>;
pmcUrl: z.ZodOptional<z.ZodString>;
pubmedUrl: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
searchUrl: z.ZodString;
notice: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, readonly [{
readonly reason: "queue_full";
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
readonly when: "Local NCBI request queue is at capacity.";
readonly recovery: "Retry after 1-2 seconds; the request queue hit the NCBI rate limit.";
readonly retryable: true;
}, {
readonly reason: "ncbi_unreachable";
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
readonly when: "NCBI E-utilities is unreachable after all retry attempts.";
readonly recovery: "Retry after a brief delay; NCBI was unreachable across all retry attempts.";
readonly retryable: true;
}, {
readonly reason: "ncbi_deadline_exceeded";
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
readonly when: "Total request deadline expired before NCBI returned a response.";
readonly recovery: "Reduce batch size or retry; NCBI may be under temporary load.";
readonly retryable: true;
}, {
readonly reason: "ncbi_invalid_response";
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
readonly when: "NCBI returned a body that could not be parsed (invalid XML/JSON).";
readonly recovery: "Retry the request; NCBI returned a malformed response that could not be parsed.";
readonly retryable: true;
}, {
readonly reason: "ncbi_resource_not_found";
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
readonly when: "NCBI returned a structured \"not found\" error for the requested ID(s).";
readonly recovery: "Verify the ID exists in PubMed; the resource was not found in NCBI and retrying will not help.";
readonly retryable: false;
}]>;
//# sourceMappingURL=search-articles.tool.d.ts.map