The Context Engine Studio is now open source.  View on GitHub →
Clinia
How-to Guides

Read a Condition Story

Read _story.md via MCP tool or REST, and choose the right format and token budget for your use case.

Read a Condition Story

A condition story is a pre-assembled Markdown narrative for a single clinical condition. It combines onset, current medications, monitoring labs, and complications from the knowledge graph into a single document, so an agent can get full context in one read.

Find the condition slug

Browse the active conditions to get the slug:

curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/vfs?path=/conditions/active" \
  -H "Authorization: Bearer <access-token>"

Each child name is the condition slug, derived from the primary display name, lowercased, with spaces replaced by underscores.

Read via REST

curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/read?path=/conditions/active/{condition}/_story.md" \
  -H "Authorization: Bearer <access-token>"

The response is { "content": "..." } where content is the Markdown narrative.

Read via MCP tool

read_patient(
  path = "/patient/{patientId}/conditions/active/{condition}/_story.md"
)

Choosing a format

Pass format to control verbosity. Default is narrative.

FormatContentTypical tokensWhen to use
narrativeFull Markdown with tables for medications, labs, complications300–800Agent needs complete clinical context
structuredMachine-readable JSON fields: codes, status, attributes, relationships200–500Downstream processing or structured extraction
compactOne paragraph with key facts only50–150Scanning many conditions before selecting one to read in full
# Compact format
curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/read?path=/conditions/active/{condition}/_story.md&format=compact" \
  -H "Authorization: Bearer <access-token>"

# Structured format
curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/read?path=/conditions/active/{condition}/_story.md&format=structured" \
  -H "Authorization: Bearer <access-token>"

Setting a token budget

Pass token_budget to cap response length. The story is rendered in full and then cut from the end — there is no per-section prioritiser — so a budget keeps as much of this order as fits:

  1. Status, onset, and codes
  2. Progression timeline
  3. Active and discontinued medications
  4. Monitoring labs
  5. Complications and related conditions
  6. Encounters
  7. Patient-reported memories
  8. Links to the source narratives
curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/read?path=/conditions/active/{condition}/_story.md&token_budget=300" \
  -H "Authorization: Bearer <access-token>"

One token ≈ 4 characters. A budget of 300 gives roughly a paragraph-length narrative. Omit token_budget for no limit.

What a story contains

A full narrative story includes:

  • Status: active / resolved, onset date
  • Codes: SNOMED, ICD-10 codes from all sources
  • Sources: how many source documents contributed to this entity
  • Current treatment: medications with prescribed_for relationship to this condition
  • Monitoring labs: labs with monitors relationship, latest values and whether in range
  • Complications: conditions with a has_complication edge pointing at them, their monitoring status
  • Provenance: which resolver matched this entity and at what confidence
  • Narratives: a link to each narrative a verification verdict ties to this condition, under _narratives/, with the verdicts it holds (corroborates, enriches, conflicts). Last in the document, so it is the first section a token_budget drops, and absent when nothing links to the condition. compact omits it.

Complications and their monitoring status come from the clinical knowledge base. They are not extracted directly from the source records.

Read the raw entity

For machine-readable fields without the narrative formatting, read the condition path itself with format=structured:

curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/read?path=/conditions/active/{condition}&format=structured" \
  -H "Authorization: Bearer <access-token>"

This returns the entity's full field set, its clinical codes, and its typed relationship edges as JSON.

See Condition Stories for a full explanation of how stories are assembled.

On this page