List descendants or ancestors of an OMOP concept
get_hierarchyRetrieve ancestors or descendants of an OMOP concept to navigate its vocabulary hierarchy, with direction filters and pagination for multi-page traversal.
Instructions
List descendants of a known OMOP concept using direction='down', or ancestors using 'up'. Use page=1 and the requested page_size. While has_more is true, set the next call’s page argument to the returned next_page and keep the same page size and filters. Read truncated to determine whether the upstream row cap was reached. A combined view cannot establish exhaustive coverage.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"concept_id": "<concept_id>"
},
"name": "get_hierarchy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page of ancestors or descendants. Combined views support only the first page. | |
| direction | No | Hierarchy direction: 'up' for ancestors, 'down' for descendants, 'both' for full context (default: 'both') | both |
| page_size | No | Nodes per direction or page. Overrides max_results. | |
| concept_id | Yes | The OMOP concept_id | |
| max_levels | No | Maximum levels to traverse (default 5 for 'up', 10 for 'down', 5/3 for 'both') | |
| max_results | No | Maximum number of nodes to return (1-200, default 200). Use a smaller value for broad concepts. | |
| vocabulary_ids | No | Comma-separated vocabulary IDs to filter results. Leave empty for all. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| has_more | No | ||
| ancestors | No | ||
| direction | Yes | ||
| next_page | No | ||
| truncated | No | ||
| concept_id | Yes | ||
| descendants | No |