Trace path
trace_pathTrace code paths through call graphs, data flow, and cross-service routes. Use for dependency and impact analysis instead of grep.
Instructions
Trace paths through the code graph. Modes: calls (callers/callees), data_flow (value propagation with args at each hop), cross_service (through HTTP/async Route nodes). Use INSTEAD OF grep for callers, dependencies, impact analysis, or data flow tracing. RESPONSE: prefix-grouped tree rows — callees/callers grouped under their shared qn-prefix, name hop per row (full qn = group prefix + dot + name); exact callees_total/callers_total on every page = ALL nodes reachable within depth (transitive, not just direct; test files excluded unless include_tests). risk/args flags use a flat table. truncated: true + next = more rows — pass next back as cursor. format="json" returns the SAME tree model as structured JSON.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | calls: follow CALLS edges. data_flow: follow CALLS+DATA_FLOWS with arg expressions. cross_service: follow HTTP_CALLS+ASYNC_CALLS+DATA_FLOWS through Routes, plus CROSS_* cross-repo edges (CROSS_HTTP_CALLS/ASYNC_CALLS/CHANNEL/GRPC_CALLS/GRAPHQL_CALLS/TRPC_CALLS) to hop into other services. | calls |
| depth | No | ||
| limit | No | Rows per page. callees_total/callers_total always carry the exact full counts; when a page is truncated the response carries next — see cursor. | |
| cursor | No | Resume token from a previous response's 'next' field. Pass it back with ALL other arguments identical to get the following page with no duplicates. Cursors outlive nothing: after a reindex you get a stale_cursor error — just re-run the original query. | |
| format | No | Response encoding. tree (default): prefix-grouped text rows. json: the SAME tree model as structured JSON (groups + column-ordered row arrays). | tree |
| project | Yes | ||
| direction | No | both | |
| edge_types | No | ||
| risk_labels | No | Add risk classification (CRITICAL/HIGH/MEDIUM/LOW) based on hop distance | |
| function_name | Yes | ||
| include_tests | No | Include test files in results. When false (default), test files are filtered out. When true, test nodes are included with a test column/marker. | |
| parameter_name | No | For data_flow mode: scope trace to a specific parameter name | |
| include_evidence | No | Add how each hop was resolved: a strategy class (lsp | language_rule | heuristic | unresolved) and the resolver's confidence. Off by default — it adds two columns per row. Use it to judge whether an edge is trustworthy, not to find edges. |