Identify the referencing resource type and the search parameter that points back to the primary resource type (e.g., Provenance:target to find Provenance resources referencing returned resources)
Add _revinclude=[ReferencingType]:[searchParam] to the search query, for example GET [base]/Patient?_id=123&_revinclude=Provenance:target
The server returns a searchset Bundle; primary results have entry.search.mode=match and reverse-included resources have entry.search.mode=include
Filter entries by search.mode=include and further by resourceType to extract the reverse-included resources
Cross-reference each included resource's reference field (e.g., Provenance.target) back to the matched primary resource by id to establish the relationship
Chain multiple _revinclude parameters in the same request if multiple referencing resource types are needed; each adds its own set of include-mode entries
Known gotchas
_revinclude is the reverse of _include: _include follows outbound references from matched resources, _revinclude finds resources that point TO matched resources — confusing the two is a common error
Not all search parameters support _revinclude; verify the parameter name (e.g., Provenance:target, not Provenance:subject) against the CapabilityStatement revInclude list
Reverse-included resources are not paginated separately; they are appended to the page they are discovered on, so the total count in Bundle.total reflects only primary match resources, not includes
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp