sample_rows
Preview the first rows of a table, view, or MongoDB collection as an aligned text table or JSON, with configurable row, byte, and timeout limits.
Instructions
Returns the first rows of a table, view, MongoDB collection or search index (default 20 rows), as run_query returns them: an aligned text table, or JSON with format=json. max_rows, max_bytes and timeout_seconds work as in run_query. The rows come in the order the database reads them: no order is implied.
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": {
"connection": "<connection>",
"schema": "<schema>",
"table": "<table>"
},
"name": "sample_rows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | The table, view or collection. | |
| format | No | `text` (an aligned table, the default) or `json`. | |
| schema | Yes | The table's schema (a database in MySQL and MongoDB, `main` in SQLite and DuckDB). | |
| max_rows | No | Rows returned at most (default 20, up to 10000). | |
| max_bytes | No | Bytes of output at most (default 32768, up to 1048576). | |
| connection | Yes | The connection's name, as `list_connections` shows it. | |
| timeout_seconds | No | Seconds the query may run before it is cancelled (default 30, up to 300). |