query
Run a read-only script against the connected Foundry world. code is the body of an async function: call foundry..({ ... }) (see docs), use await, console.log, and return the value you want back (JSON, size-limited). Only read methods are bound; writes are not available here — use execute. Every call counts against the per-script limits shown in the docs index (calls, wall time, CPU time, result size); an oversized call result arrives as { __truncated: true, bytes, limit, preview }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Body of an async function: `const actors = await foundry.actors.list({}); return actors.length;` |