Skip to main content
Each agent has one private SQLite database that no other agent can read. Each Box has a second database that every agent in it reads and writes. These tools reach both, so you can lay out the tables an agent works from before it ever runs. It is plain SQLite. Column types are TEXT, INTEGER, REAL, BLOB or NUMERIC.

Agent database

list_tables

Structure of the agent private database: every table with its columns, types, primary keys and not-null flags.
string
required

db_query

Runs a read-only SELECT and returns the rows. Anything that writes is refused here.
string
required
string
required
A single SELECT, or WITH … SELECT.
array
Values bound to the ? placeholders, in order.
number
Maximum rows returned. Default 100, maximum 1000.
Request arguments
Use ? placeholders with params rather than pasting values into the SQL.

db_execute

Changes the agent private database: CREATE, ALTER, DROP a table, or INSERT, UPDATE, DELETE rows.
string
required
string
A single statement.
array
Values bound to the ? placeholders in sql, in order.
object[]
Several statements applied atomically in one transaction. Each entry needs sql and may carry params. This is the right way to lay out a whole schema.
Pass either sql or statements. The call fails if you pass neither.
Request arguments

Box database

The same three operations, on the database every agent of one Box shares. Get the spaceId from list_spaces.

list_space_tables

string
required

space_db_query

string
required
string
required
array
number
Default 100, maximum 1000.

space_db_execute

string
required
string
array
object[]
Every agent in the Box sees the result immediately. Prefer CREATE TABLE IF NOT EXISTS, extend with ALTER TABLE ADD COLUMN, and do not drop a table the agents already fill.