settle
Drain the JavaScript event loop to run pending microtasks and timer callbacks. Use after DOM setup or eval to execute scheduled code immediately.
Instructions
Drain the JS event loop: alternately runs queued microtasks (Promise resolutions) and fires expired setTimeout/setInterval callbacks, sleeping to the next deadline when only timers remain. Returns when the queue is empty OR max_ms elapses OR max_iters iterations complete. Defaults: max_ms=2000, max_iters=50. Use after seeding the DOM (or after eval'd code that schedules timers) to let pending callbacks run.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "settle"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_ms | No | Max wall-clock ms to spend (default 2000) | |
| max_iters | No | Max iterations of the drain loop (default 50) |