Query the database (read-only)
query_databasePHP + MySQL plans: runs one read-only SQL statement (SELECT, SHOW, DESCRIBE, EXPLAIN or WITH … SELECT) against the site's database and returns the rows. Runs in a read-only transaction; use execute_sql to change data. Use ? placeholders with params for values.
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": {
"site": "<site>",
"query": "<query>"
},
"name": "query_database"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | The website's domain, as shown by list_sites (e.g. "example.com" or "name.hostingfor.ai"). | |
| query | Yes | One SQL statement. | |
| params | No | Values for ? placeholders, in order. | |
| max_rows | No | Maximum number of rows to return. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| rows | No | One object per row, keyed by column name. | |
| columns | No | ||
| warnings | No | ||
| insert_id | No | ||
| more_rows | No | ||
| row_count | No | ||
| duration_ms | Yes | ||
| affected_rows | No |