Skip to main content
POST
/
talk2data
/
mcp
/
generate-sql
Generate Sql
curl --request POST \
  --url https://api.example.com/talk2data/mcp/generate-sql \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "question": "<string>",
  "database": "<string>",
  "schema": {
    "schema_name": "<string>",
    "schema_fqn": "<string>",
    "selected_tables": [
      {
        "table_name": "<string>",
        "table_fqn": "<string>"
      }
    ]
  }
}
'
{
  "sql": "<string>",
  "explanation": "<string>",
  "assumptions": []
}

Documentation Index

Fetch the complete documentation index at: https://docs.emergence.ai/llms.txt

Use this file to discover all available pages before exploring further.

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 SQL generation.

question
string
required

Natural language question to convert to SQL

Minimum string length: 1
database
string
required

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

Minimum string length: 1
schema
DatasourceSelectedSchema · object
required

Schema to scope the query. schema_fqn must be a 3-segment FQN: connection.database.schema.

Response

Successful Response

Synchronous SQL generation result.

sql
string
required
explanation
string
required
assumptions
string[]