query_across_databases
Runs one read-only DuckDB SQL statement across tables from multiple database connections by copying each source into a temporary DuckDB instance for cross-database joins, masking sensitive values.
Instructions
Runs one read-only DuckDB statement over tables of several connections: each source (connection, schema, table, optional name) is copied, up to source_rows rows (default 10000, up to 100000) and within that connection's limits, into a DuckDB of this call, where the statement joins them by name. Every connection must be open to agents; the statement runs only on the copies, cannot write to a source and reads no file nor URL. Values of sensitive columns are masked before they are copied (unless the user shows them for that connection): all values of such a column are equal, so do not join on one. A source copied in part is said so. Use DuckDB's SQL. Same result format and limits as run_query.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sources": "<sources>",
"sql": "<sql>"
},
"name": "query_across_databases"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One read-only DuckDB statement over the sources, by their `name`. | |
| format | No | `text` (an aligned table, the default) or `json`. | |
| sources | Yes | The tables to join, up to 8, each from a connection open to agents. | |
| max_rows | No | Rows returned at most (default 100, up to 10000). | |
| max_bytes | No | Bytes of output at most (default 32768, up to 1048576). | |
| source_rows | No | Rows copied from each source (default 10000, up to 100000), within the connection's limits. A table with more rows is copied in part, and the answer says so. | |
| timeout_seconds | No | Seconds each read and the statement may run before it is cancelled (default 30, up to 300). |