postSql
Execute SQL statements (SELECT, INSERT, UPDATE, DELETE, MERGE) with parameter binding and output in JSON, CSV, GeoJSON, or spatial formats.
Instructions
Execute SQL statements.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "postSql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | SQL statement to run. Allowed: SELECT, INSERT, UPDATE, DELETE, MERGE. Not allowed: DDL, transaction control. | |
| params | No | Parameters for the statement. For SELECT, only one parameter set is allowed. | |
| type_hints | No | Type hints for JSON-encoded parameters that are not JSON/JSONB in the database. | |
| type_formats | No | Formatting rules for typed parameters, e.g. date formats. | |
| output_format | No | Output format. Supported: json, geojson, csv, ccsv, ndjson, excel, or ogr/<format> (e.g. ogr/ESRI Shape). ccsv and ndjson are streamed. | json |
| srs | No | EPSG code for the spatial reference system used for PostGIS geometry output. |