Tool

execute

When query and read together are not enough, drop into JavaScript with all the same data at hand. Compose what does not exist as a single tool; store the reusable part so the next composition is one import away.

(async () => { const hot = await repoql.query(`SELECT uri, commits FROM git_hotspots() LIMIT 10`); const dot = 'digraph{' + hot.map(r => `"${r.uri}"`).join(';') + '}'; return repoql.graphviz(dot); // an SVG, from a query, in one call })()

Scripts run as a QuickJS–WASM module, so top-level return is a syntax error — wrap the body in an immediately-invoked function as above. Return plain values: objects and arrays render as tables.

Run it yourself

rql execute --file hotspots.js

Or say it to your agent

“chart the ten files with the most churn as a graphviz diagram”

Parameters

ParameterWhat it does
coderequiredThe JavaScript to run.
intentoptionalA short line on what you are trying to accomplish. It should stand alone.
tokenBudgetoptionalRoom for the response.
timeoutoptionalExecution deadline in milliseconds.

What is in scope

In the sandboxWhat it does
repoql.query(sql)The full SQL surface, returning rows.
repoql.read(uri, opts)Any address, with its budget and representation.
repoql.write(uri, content) · repoql.delete(uri)Write results back into the sandbox for later steps.
repoql.graphviz(dot) · repoql.svgToPng(svg)Render diagrams from data you just computed.
repoql.ffmpeg({...})Probe or transform media.
mcp.servers() · mcp.tools(name) · mcp.<server>.<tool>(args)Call any approved MCP tool and get parsed results back.
import("yaml"), import("diff"), import("semver")Built-in modules, plus the others the sandbox ships.

When not to reach for it

If one SQL statement would do the job, write the statement. execute earns its place when the work is imperative — branching on intermediate values, accumulating across iterations, retrying — or when the output is not a table at all.

This page names what exists. The depth behind every name — the bounds, the failure modes, how they compose — ships inside the binary at help:///, and answers to explore and read exactly like your code does. Install it, and your agent has the manual.