Skip to content

find_paths

Find paths · read tool

How two Elements are connected: the Relationships directly between them both ways, declared or derived from their descendants’ (each derived edge lists the declared Relationships beneath it), and the shortest paths each way up to max_hops, each hop with its Relationships. Compared at the levels of the two Elements given. A via broker counts as a hop.

Field Type Required Notes
from string yes A qualified id, project:id.
to string yes A qualified id, project:id.
max_hops integer The longest path to look for, in hops. Default: 4. At least 1. At most 10.
limit integer The most items to return; truncated says whether there were more. Default: 50. At least 1. At most 9007199254740991.
at string A point in time to answer at: a tag, a commit sha or its first 4 or more characters, or a date (YYYY-MM-DD) or time (ISO 8601, UTC unless it gives a zone). On a checkout, any git ref works too. Leave out for the current Workspace.
Field Type Required Notes
from string yes
to string yes
maxHops number yes
direct list of object yes
direct[].from string yes
direct[].to string yes
direct[].derived boolean yes
direct[].relationships list of object yes
total number yes
truncated boolean yes
paths list of object yes
paths[].hops list of object yes

Called over the Kitchen sink example Workspace.

Arguments:

{
"from": "sink:customer",
"to": "sink:orders-db"
}

Result:

{
"from": "sink:customer",
"to": "sink:orders-db",
"maxHops": 4,
"direct": [],
"total": 1,
"truncated": false,
"paths": [
{
"hops": [
{
"from": "sink:customer",
"to": "sink:web",
"relationships": [
{
"id": null,
"from": "sink:customer",
"to": "sink:web",
"description": "Uses",
"technology": "HTTPS",
"interaction": "sync",
"via": null,
"channel": null,
"tags": [],
"source": {
"file": "examples/kitchen-sink/archidocs/sink/model.yaml",
"line": 7
}
}
]
},
{
"from": "sink:web",
"to": "sink:api",
"relationships": [
{
"id": null,
"from": "sink:web",
"to": "sink:api",
"description": "Calls",
"technology": "JSON/HTTPS",
"interaction": "sync",
"via": null,
"channel": null,
"tags": [],
"source": {
"file": "examples/kitchen-sink/archidocs/sink/model.yaml",
"line": 28
}
}
]
},
{
"from": "sink:api",
"to": "sink:orders-db",
"relationships": [
{
"id": null,
"from": "sink:orders",
"to": "sink:orders-db",
"description": "Stores orders in",
"technology": "SQL",
"interaction": "sync",
"via": null,
"channel": null,
"tags": [],
"source": {
"file": "examples/kitchen-sink/archidocs/sink/model.yaml",
"line": 49
}
}
]
}
]
}
]
}

A call that fails returns isError: true, with {code, message, suggestions?} as structuredContent. This tool returns:

  • invalid_input when the arguments don’t fit the input above.
  • not_found when an id or name, or the point in history given as at, matches nothing, or a sha prefix starts more than one Revision, with the candidates.
  • source_unavailable when the server can’t read the Workspace.
  • history_unavailable when the Workspace has no history to read at at.

Error codes says what to do about each.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.