> For the complete documentation index, see [llms.txt](https://docs.biobox.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.biobox.io/guide/how-to/ask-biobox-with-claude/tools/expand-anchor.md).

# expand\_anchor — Expand an anchor up/down its is-a relationships

Expand an anchor up/down its is-a relationships

Expand an anchor up/down its is-a relationships

## What it does

From a specific object, walk the relationships you treat as "is a" (up=broader, down=narrower, both) to find alternative anchor objects — e.g. fall back to a parent disease when the exact one has no data. Each result carries a has-data proxy.

**When to use:** the exact anchor has no/too-little data and you want a broader parent (direction up) to re-anchor on; you want the narrower children (direction down) of an anchor to see if a specific one is meant.

**When NOT to use:** you want the ontology CLASS hierarchy (subtypes of a type) — use describe\_entity\_type; you want an object's neighbours along a NON-hierarchy relationship — use get\_entity\_connections; you still need to resolve the name to a uuid — use search\_entities\_fulltext / \_fuzzy first.

**Parameters:**

* `uuid` — the anchored object's uuid (from search\_entities\_\* / get\_entity).
* `relationshipTypes` — the relationship type(s) to treat as "is a" for this walk (e.g. \["subtype\_of"]). Required.
* `direction` — "up" (broader), "down" (narrower), or "both" (default).
* `depth` — max hops to walk (optional; default 2, max 5).
* `limit` — max alternatives to return (optional; default 25, max 50).

**Returns:** An object { anchors, count }. Each anchor is { uuid, displayName, dbLabels, distance, connectionCount } sorted nearest-first then most-connected. `connectionCount` is the neighbour's total degree — a proxy for "has data"; prefer a well-connected alternative when re-anchoring. `uuid` is the drill handle for the next tool.

## Parameters

| Parameter           | Type   | Required | Description                                                                                  |
| ------------------- | ------ | -------- | -------------------------------------------------------------------------------------------- |
| `uuid`              | string | yes      | the anchored object's uuid (from search\_entities\_\* / get\_entity).                        |
| `relationshipTypes` | array  | yes      | the relationship type(s) to treat as "is a" for this walk (e.g. \["subtype\_of"]). Required. |
| `direction`         | enum   | no       | "up" (broader), "down" (narrower), or "both" (default).                                      |
| `depth`             | number | no       | max hops to walk (optional; default 2, max 5).                                               |
| `limit`             | number | no       | max alternatives to return (optional; default 25, max 50).                                   |

## Response

```ts
{
  anchors: Array<{
    uuid: string;
    displayName: string | null;
    dbLabels: string[];
    distance: number;
    connectionCount: number;
  }>;
  count: number;
}
```

## Example

```json
// expand_anchor({"uuid":"EFO:0000756","relationshipTypes":["is a"],"direction":"up"})
{
  "uuid": "EFO:0000756",
  "relationshipTypes": [
    "is a"
  ],
  "direction": "up"
}
```

Response (arrays truncated):

```json
{
  "anchors": [
    {
      "uuid": "MONDO:0021143",
      "displayName": "melanocytic neoplasm",
      "dbLabels": [
        "MONDO",
        "Disease",
        "EFO"
      ],
      "distance": 1,
      "connectionCount": 15
    },
    {
      "uuid": "EFO:0000616",
      "displayName": "neoplasm",
      "dbLabels": [
        "Disease",
        "EFO",
        "SafetyLiability",
        "… 1 more"
      ],
      "distance": 2,
      "connectionCount": 52530
    },
    {
      "uuid": "MONDO:0005070",
      "displayName": "MONDO duplicate: neoplasm",
      "dbLabels": [
        "MONDO",
        "Disease"
      ],
      "distance": 2,
      "connectionCount": 7910
    },
    "… 1 more"
  ],
  "count": 4
}
```
