Generate test row for
generate_test_row_forGenerates a single realistic PostgreSQL test row using catalogue metadata, skips generated columns, samples foreign-key values, and returns ready-to-run INSERT SQL without executing it.
Instructions
Generate ONE realistic test row for a table — catalogue-aware. Skips identity / generated columns (server fills them in), samples one existing row from each referenced table for FK columns (so the row inserts cleanly), and uses column-name heuristics (*_email → user_N@example.com, *_url → https://example.com/r/N, *_at → recent timestamp, etc.) to make values look like data. Sibling of generate_test_data (bulk) — designed for the shadow-migration workflow where a single realistic row matters more than volume. Returns an object with insert_sql (one ready-to-execute INSERT), columns (per-column ColumnFill with sql_literal + heuristic explanation), schema, table. Does NOT execute the INSERT — caller applies via run_write when ready.
Example: generate_test_row_for(schema='public', table='orders', seed=42)
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": {
"schema": "<schema>",
"table": "<table>"
},
"name": "generate_test_row_for"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| table | Yes | ||
| schema | Yes | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| follow_foreign_keys | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | Yes | ||
| columns | Yes | ||
| insert_sql | Yes |