execute_query
Execute SQL queries against databases to retrieve, insert, update, or delete data using supported database connections and return results in JSON or CSV format.
Instructions
Execute a SQL query against a database and return results
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection_string | No | Database connection URL or configured connection name. Can be a full URL (e.g., "postgres://user:pass@localhost/db") or a connection name from env vars (e.g., "oracle" for USQL_ORACLE, "postgres" for USQL_POSTGRES) | |
| output_format | No | Output format for query results (default: json) | |
| parameters | No | Optional query parameters for prepared statements | |
| query | Yes | SQL query to execute (SELECT, INSERT, UPDATE, DELETE, etc.) | |
| timeout_ms | No | Optional timeout in milliseconds for this call (overrides defaults). Use null for unlimited. |
Input Schema (JSON Schema)
{
"properties": {
"connection_string": {
"description": "Database connection URL or configured connection name. Can be a full URL (e.g., \"postgres://user:pass@localhost/db\") or a connection name from env vars (e.g., \"oracle\" for USQL_ORACLE, \"postgres\" for USQL_POSTGRES)",
"type": "string"
},
"output_format": {
"description": "Output format for query results (default: json)",
"enum": [
"json",
"csv"
],
"type": "string"
},
"parameters": {
"description": "Optional query parameters for prepared statements",
"items": {
"type": [
"string",
"number",
"boolean",
"null"
]
},
"type": "array"
},
"query": {
"description": "SQL query to execute (SELECT, INSERT, UPDATE, DELETE, etc.)",
"type": "string"
},
"timeout_ms": {
"description": "Optional timeout in milliseconds for this call (overrides defaults). Use null for unlimited.",
"minimum": 1,
"type": [
"number",
"null"
]
}
},
"required": [
"query"
],
"type": "object"
}