automation_session_commands
Read the step-by-step command history of a run — every action it performed, in order, with duration and pass/fail per step. THIS IS THE DEBUGGING TOOL: to explain why a run failed, fetch it with failuresOnly=true to land directly on the failing step, then read the steps immediately before it for context. When a failed run has NO failed command — an assertion failure, where every WebDriver call succeeded and the test reported the verdict itself — failuresOnly returns no steps and a whyNoFailedSteps block naming what the run reported and which step carried it, so an empty list is never mistaken for "nothing went wrong" and you do not need to re-fetch the whole history to find out. Each entry carries the error message when the step failed, and every element-scoped step (click, sendKeys, getText…) carries the locator that found its element plus the index of the find it came from — so a click at step 24 reads as the button it clicked, not an opaque id. On a run that is still going this returns the steps completed so far, so it is also how you answer "where has it got to?". For browser runs, follow up with session_console_logs / session_network_logs using the SAME session id to see whether a JS error or a failed request explains it. Output is summarised and capped, so ask for a filtered view rather than everything — when a step needs explaining, take its index to automation_session_step for the request/response bodies and the locator behind an element id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max steps to return (default 200, which is also the ceiling). Returns the LAST n steps, not the first — a run that fell over did so at the end. On a long run that means the window can exclude the very failure `firstFailureIndex` points at, so use failuresOnly=true to land on it instead of raising this. | |
| sessionId | Yes | The run's session id. | |
| failuresOnly | No | Return only steps that failed. Use this FIRST when debugging — it is usually one or two rows out of hundreds. |