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.

73 lines 3.58 kB
/** * @fileoverview Citation lookup tool. Resolves partial bibliographic references * to PubMed IDs using NCBI's ECitMatch service, then verifies author agreement * against ESummary to catch cases where ECitMatch's journal+volume+page weighting * returns a PMID whose author roster doesn't contain the queried author. * @module src/mcp-server/tools/definitions/lookup-citation.tool */ import { z } from '@cyanheads/mcp-ts-core'; export declare const lookupCitationTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{ citations: z.ZodArray<z.ZodObject<{ journal: z.ZodOptional<z.ZodString>; year: z.ZodOptional<z.ZodString>; volume: z.ZodOptional<z.ZodString>; firstPage: z.ZodOptional<z.ZodString>; authorName: z.ZodOptional<z.ZodString>; key: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ results: z.ZodArray<z.ZodObject<{ key: z.ZodString; pmid: z.ZodOptional<z.ZodString>; matched: z.ZodBoolean; status: z.ZodEnum<{ matched: "matched"; not_found: "not_found"; ambiguous: "ambiguous"; }>; detail: z.ZodOptional<z.ZodString>; candidatePmids: z.ZodOptional<z.ZodArray<z.ZodString>>; matchedFirstAuthor: z.ZodOptional<z.ZodString>; warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{ code: z.ZodEnum<{ author_mismatch: "author_mismatch"; year_mismatch: "year_mismatch"; }>; message: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>>; totalMatched: z.ZodNumber; totalSubmitted: z.ZodNumber; totalWarnings: z.ZodNumber; }, 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=lookup-citation.tool.d.ts.map