generate_sql
Converts natural language questions into validated SQL SELECT queries by leveraging database schema context.
Instructions
Generate a SQL query from a natural language question. Uses the database schema as context and an LLM to produce a valid SELECT query. The generated query is validated for safety.
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": {
"question": "<question>"
},
"name": "generate_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Schema to use for context | public |
| question | Yes | Natural language question (e.g., 'What are the top 10 customers by order count?') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |