Skip to main content
Upload a health document and Mirobody parses it into the Subject’s store. PDFs and images go through OCR (original text kept for read_file); Excel / CSV are parsed structurally (long/wide tables auto-detected) into health records. The chat agent then reads files with its read_file / ls tools.

Upload & parse

POST /v1/files
Authorization: Bearer mb_live_*
Content-Type:  multipart/form-data
FieldDescription
fileThe document (PDF / image / Excel / CSV).
userSubject the file belongs to.
retentionpermanent (default) / session / 1d.
curl https://mcp.thetahealth.cn/v1/files \
  -H "Authorization: Bearer $MIROBODY_API_KEY" \
  -F "user=alice" \
  -F "file=@checkup_2026.pdf"
Response:
{
  "file_key": "uploads/20260616_xxx.pdf",
  "filename": "checkup_2026.pdf",
  "indicators": ["fasting_glucose", "hba1c", "ldl"],
  "abstract": "Annual checkup — glucose slightly elevated ...",
  "subject": "alice"
}

List files

GET /v1/files?user=alice
Authorization: Bearer mb_live_*
[
  { "file_key": "uploads/20260616_xxx.pdf", "filename": "checkup_2026.pdf", "file_type": "application/pdf", "created_at": "2026-06-16T07:40:00Z" }
]

Fetch parsed text

GET /v1/files/{file_key}
Authorization: Bearer mb_live_*
Returns the parsed text and abstract for one file — the same content the agent’s read_file tool sees.
No public delete-file endpoint. Files are cleaned up by their retention: 1d / session data expires automatically, and ending a session with DELETE /v1/sessions/{id} purges that session’s data immediately. permanent files persist until removed by an operator.