Do the task on the live websites and return the result
runExecutes the task on the real websites and returns the result. Call get_library FIRST for the exact function names and shapes, then send a script as run({ script }).
THE SCRIPT is a plain async JavaScript body, not a wrapping function. bowmark is a ready global: await bowmark.<capability>.<fn>(...), or one site via await bowmark.providers.<provider>.<fn>(...). return what you want back; log(...) for progress. Built-ins plus URL/URLSearchParams exist; fetch, import, setTimeout and a filesystem do not — bowmark is the only I/O.
MIND THE CLOCK. Your client times a tool call out at around 55 seconds, and one capability call already spends 30-55 seconds, so default to ONE per script. Need several? Run them together in Promise.allSettled (a dropped leg still comes back as partial), never one after another, and never await inside a for loop. Keep the result under ~25,000 characters.
CHECK status BEFORE ok — ok | error | partial | needs_user | running:
• running: it is still going. Call run({ runId }) to wait for the SAME run; never resend the script.
• partial: result is real but narrower than asked; incomplete names what did not answer. Tell your user — never call it complete. incomplete.failures[].fixable: true means your argument was wrong: fix it and rerun.
• needs_user: a site needs your user signed in; not a failure. Give them meta.handoff.url, name the sites, then call wait_for_sign_in with meta.handoff.ref. On done, send the SAME script unchanged.
• error: there is no result; error says why.
Saving files, one exit IP, saved secrets, warnings, emptyHanded, and the billed browser_agent/delegate fallbacks: get_library({ query: "run guide" }).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runId | No | Only to collect a run an earlier call answered `status: "running"` for: pass its `runId` and no `script`, and this call waits for that same run's result. | |
| script | No | The JavaScript script body to execute (async, against the `bowmark` global). e.g. `const { flights, warnings } = await bowmark.flights.search({from:'SFO',to:'JFK',depart:'2026-09-01'}); return { best: flights.sort((a,b)=>a.price-b.price)[0], warnings };` |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ms | No | ||
| ok | Yes | ||
| logs | No | ||
| meta | No | ||
| error | No | ||
| needs | No | ||
| notes | No | ||
| runId | No | ||
| notice | No | ||
| result | No | ||
| status | No | ||
| queuedMs | No | ||
| incomplete | No | ||
| savedFiles | No | ||
| emptyHanded | No | ||
| secretNeeds | No | ||
| savedSecrets | No |