code_route_trace
code_route_trace follows a full request chain from the HTTP route through the controller, service layer, repository, and down to the database call. It combines route lookup with recursive call tracing in a single query.
code_route_trace(route="/api/users", method="GET")code_route_trace(route="/api/orders", method="POST")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
route | string | required | URL path to trace |
method | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | — | HTTP method |
Output
Section titled “Output”POST /api/orders → OrderController.create (src/controllers/order.ts:31) → OrderService.checkout (src/services/order.ts:42) → PaymentService.charge (src/services/payment.ts:18) → stripe.charges.create (external) → InventoryService.reserve (src/services/inventory.ts:91) → db.query (src/db/client.ts:7) → orders table (postgres)When to use
Section titled “When to use”- Debugging a slow or failing API endpoint — trace exactly what it touches
- Security review — understand every side effect of a route
- Onboarding — learn how the system is layered for a given feature
- Documentation — generate accurate request flow diagrams
Difference from code_trace
Section titled “Difference from code_trace”| Tool | Starting point |
|---|---|
code_trace | A specific function name |
code_route_trace | An HTTP route path |
code_route_trace adds the route-to-handler resolution step automatically.