Skip to content

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")
ParameterTypeDefaultDescription
routestringrequiredURL path to trace
method"GET" | "POST" | "PUT" | "DELETE" | "PATCH"HTTP method
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)
  • 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
ToolStarting point
code_traceA specific function name
code_route_traceAn HTTP route path

code_route_trace adds the route-to-handler resolution step automatically.