Sample rows of a table
pg_sample_rowsPreview a table or view by returning a small sample of rows, optionally limited to selected columns or randomized, to inspect data shape without running a full query.
Instructions
Show a few rows of a table or view to see what the data looks like.
Pick columns to keep the answer small; by default every column the connection allows
is listed (columns protected by the connection's rules are left out, and values of
credential-like columns are redacted). limit is at most 100. By default the rows are
simply the first ones the server finds, in no particular order; random=true draws a
random sample instead (on a big table this reads the whole table once, so it can take a
while; the time limit of the connection applies). For a filtered read use pg_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": {
"table": "<table>"
},
"name": "pg_sample_rows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| table | Yes | ||
| random | No | ||
| columns | No | ||
| connection | No |