Overview
contox_get_links retrieves the links (relationships) for a specific context identified by its schemaKey. Links form a knowledge graph that expresses relationships between contexts, such as dependencies, cross-references, and hierarchical connections.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
schemaKey | string | Yes | — | The schemaKey of the context (e.g., "root/api/auth") |
direction | enum | No | "both" | Filter direction: "both", "outgoing", or "incoming" |
Return value
Returns links organized by direction:
Outgoing links (from this context to others):
| Field | Type | Description |
|---|---|---|
toSchemaKey | string | Target context schemaKey |
linkType | string | Relationship type: see-also, depends-on, child-of, related |
reason | string or null | Why this link exists |
confidence | number or null | Confidence score (0-1) |
Incoming links (from other contexts to this one):
| Field | Type | Description |
|---|---|---|
fromSchemaKey | string | Source context schemaKey |
linkType | string | Relationship type |
reason | string or null | Why this link exists |
confidence | number or null | Confidence score (0-1) |
Usage examples
Viewing all links for a context
Claude calls: contox_get_links({ schemaKey: "root/api/auth" })
Response:
## Outgoing (2)
- -> root/api/users [depends-on] — Auth middleware is required for user endpoints (conf: 0.9)
- -> root/conventions [see-also] — JWT token format conventions
## Incoming (1)
- <- root/frontend/hooks [depends-on] — useAuth hook calls auth API endpoints (conf: 0.85)
Viewing only incoming dependencies
Claude calls: contox_get_links({
schemaKey: "root/api/auth",
direction: "incoming"
})
Notes
- If no links exist for the given schemaKey, the response will indicate "No links found".
- Links are directional — an outgoing link from A to B does not automatically create an incoming link from B to A (though the reverse may exist independently).
- Use
contox_add_linkto create new links between contexts.