Search Medical Papers

Search medical and biomedical papers with a natural-language question. Federates PubMed, PMC full-text, ClinicalTrials.gov, and Semantic Scholar, then synthesizes a cited answer. Implementation: invokes the `medical-agent` Lambda (TypeScript, Mastra, Claude Sonnet). Streaming responses flow through the `captain-stream` S2 basin — identical pattern to `/v2/collections/{name}/query`.

Request

This endpoint expects an object.
questionstringRequired3-2000 characters

Natural-language question.

include_trialsbooleanOptionalDefaults to true
Whether the agent may call ClinicalTrials.gov.
max_sourcesintegerOptional1-25Defaults to 10
Target number of cited sources in the final answer.
recency_yearsintegerOptional1-50
Prefer evidence within the last N years where the question allows.
streambooleanOptionalDefaults to false

If true, response is text/event-stream; otherwise JSON.

Response

Synthesized answer with cited sources. Returns JSON by default; when stream=true the response is text/event-stream with tool.start, tool.end, text.delta, and run.end events.

answerstring
Synthesized answer with inline citations.
domainstring
The scientific domain, e.g. 'medical'.
gapslist of strings
Things the agent could not find or verify.
latency_msintegerDefaults to 0

End-to-end wall-clock latency.

sourceslist of objects
tool_callsintegerDefaults to 0
Number of tool calls the agent made.

Errors

400
Search Medical Papers Request Bad Request Error
401
Search Medical Papers Request Unauthorized Error
403
Search Medical Papers Request Forbidden Error