fetch_rows
Fetch the next batch of rows from an open query cursor to page through large result sets. Returns rows, row count, and an exhausted flag, and closes the cursor once fully drained.
Instructions
Fetch the next N rows from an open cursor (see open_query_cursor).
Returns meta, rows, row_count, exhausted and cursor_closed;
meta.database is null, since a cursor_id names no database. The cursor closes
itself once fully drained, and also when the read fails: the error is raised and
the cursor_id stops working, so re-open the query to read again. Fetch one batch
at a time: a call made while another is running on the same cursor is refused,
and the cursor and the running call carry on.
Rows arrive on the text channel only, inside the untrusted-data banner: this
tool emits no structuredContent. Values render as on execute_read_query (bytea as
\x hex text).
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": {
"cursor_id": "<cursor_id>"
},
"name": "fetch_rows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | How many rows to fetch in this batch (default 100). | |
| cursor_id | Yes | The cursor_id returned by open_query_cursor. An id that was fully read, closed, failed or reaped after 15 idle minutes is an error. |