trace_calls
Start tracing function calls on a module and get a file path to review the captured trace entries.
Instructions
Start tracing function calls on a module. This tool does NOT return the trace results directly — it writes them to a file and returns the file path.
WORKFLOW:
Call this tool → you get back a file path (e.g. /tmp/beam_scope_traces/MyModule_20260323_221503.log)
Wait a few seconds for the trace to collect events
Read the file using your normal file reading tools (Read tool) to see the trace results
The trace auto-stops when it hits max_calls or max_seconds — you do NOT need to call stop_trace
WHY A FILE: Traces collect events over time and can be large. Writing to a file lets you read just the parts you need (head, tail, grep for patterns).
The file contains timestamped entries like: [22:15:03.001] #1 #PID<0.599.0> MyModule.my_function("arg1", 42)
All parameters except function are REQUIRED. max_calls capped at 200, max_seconds capped at 30.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| module | Yes | Module to trace (e.g. "Merlinex.Core.Manager"). Required. | |
| function | No | Specific function name (optional — omit to trace all functions in the module) | |
| max_calls | Yes | Stop after this many calls (required, max 200) | |
| max_seconds | Yes | Stop after this many seconds (required, max 30) |