Upload Lab Results (MCP)
Upload a PDF, review extracted values, approve.
Two upload paths
| Tool | Use when |
|---|---|
getLabResultFileUploadEndpoint() | Preferred. Agent can make HTTP requests. Returns multipart upload URL + cURL example. Same API key as MCP. |
getLabResultUploadLink() | Fallback. Agent cannot make HTTP requests. Returns a platform link for manual user upload. |
Step-by-step
- Call
getLabResultFileUploadEndpoint()— returnsuploadUrl,method,contentType,fileField,maxSizeMB, and a ready-to-use cURL example - Upload the PDF:
POSTwith multipart body, field namefile,Authorization: Bearer bk_* - Poll
getUserLabRecords()for status — PENDING → PROCESSING → PROCESSED (usually seconds to minutes) - Once PROCESSED:
getLabRecordDetail(externalId)— review patient info, test details, biomarker array - If anything looks wrong:
updateLabResultBiomarker— fix or delete an individual biomarkerupdateLabResultMetadata— fix patient or test details
updateLabResultStatus(externalId, "APPROVE")— biomarkers become visible insearchBiomarkersand biological age recalculates
If extraction was wrong
updateLabResultStatus(externalId, "REPROCESS")— re-runs PDF extractionupdateLabResultStatus(externalId, "ROLLBACK")— reverts APPROVED → PROCESSED (hides biomarkers)
Tips
- Always show the extracted values to the user and get explicit approval before calling
APPROVE - The cURL example in
getLabResultFileUploadEndpointis copy-paste ready — agents can render it for the user when MCP HTTP isn't available

