Skip to main content
POST
/
talk2data
/
mcp
/
execute-query
Execute Query Endpoint
curl --request POST \
  --url https://api.example.com/talk2data/mcp/execute-query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sql": "<string>",
  "database": "<string>",
  "max_rows": 500
}
'
{
  "columns": [
    "<string>"
  ],
  "rows": [
    {}
  ],
  "row_count": 123,
  "truncated": true,
  "sql": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for synchronous query execution.

sql
string
required

SQL query to execute (SELECT only). Identifier-case and quoting rules vary by warehouse and by how each schema was defined (Snowflake folds unquoted to UPPERCASE; Postgres folds unquoted to lowercase; mixed-case-quoted identifiers must be quoted on every reference). LLM-authored SQL frequently fails compilation for this reason. Prefer calling generate-sql first — it has catalog knowledge of the connected schema and emits SQL with correct quoting — then pipe its returned SQL into this endpoint verbatim.

Minimum string length: 1
database
string
required

Resource URI of the data connection (e.g. data:org:project:name)

Minimum string length: 1
max_rows
integer
default:500

Maximum rows to return

Required range: 1 <= x <= 5000

Response

Successful Response

Synchronous query execution result.

columns
string[]
required
rows
Rows · object[]
required
row_count
integer
required
truncated
boolean
required
sql
string
required