The Context Engine Studio is now open source.  View on GitHub →

Search Patient Data

Use the search_patient MCP tool to find facts and events by keyword.

The Clinia Context Engine maintains a full-text index over all ingested patient data. The index covers entity display names, clinical codes, and attribute text. Search is available via the search_patient MCP tool.

Make the call

plaintext
search_patient(
  patient_id = "{patientId}",
  query      = "{query}"
)

Query patterns

Single term (matches fact names, event summaries and document text):

plaintext
search_patient(patient_id = "{patientId}", query = "tiotropium")

Multi-term (a result must contain every term; results are ranked by how well they match):

plaintext
search_patient(patient_id = "{patientId}", query = "COPD exacerbation")

Matching is on English word stems, so medications matches medication.

Interpreting results

Results come back as a Markdown list. Each entry is a path, then its preview on the next line:

md
- /medications/active/fct_j9n3v6b1k8d4s7x2c5y0p4q1
  tiotropium, inhalation — active
- /timeline/2023/ece_r2k8w5n1c7x4v9q3z6b0m8t2
  2023-02-14 [encounter] COPD exacerbation; tiotropium continued, prednisone added
- /sources/progress_note/en_g9pzqpksszgn6fdnena1aht4/respirology_follow_up_ena1aht4.md
  Respirology follow-up with spirometry

Each result has:

  • A path: the VFS path of the matching item, relative to the patient. Pass it directly to read_patient to retrieve the full content.
  • A preview: a one-line summary of the item, not the passage that matched.

Agent workflow

Search is most useful when the agent doesn't know the exact VFS path. A typical pattern:

  1. search_patient with a keyword to get candidate paths
  2. read_patient on the most relevant path to get full content
  3. Repeat for additional context if needed

Prefer browse_patient when the agent knows the category it wants (e.g. "list active conditions"). Use search when the agent knows a term but not where in the VFS it lives.

On this page