ai_query_mssql
Generate and execute safe read-only MSSQL SELECT queries from natural language instructions using Gemini AI. Validate queries and return results with configurable row limits and schema restrictions.
Instructions
Generate a safe read-only MSSQL SELECT from instruction via Gemini, validate, execute, and return rows.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
allowedSchemas | No | Optional whitelist of schemas (e.g., ['dbo','sales']) | |
allowedTables | No | Optional whitelist of fully qualified tables (e.g., ['dbo.customer_dummy']) | |
instruction | Yes | Natural language request to query MSSQL (Thai/English) | |
maxRows | No | Max rows to return |
Input Schema (JSON Schema)
{
"properties": {
"allowedSchemas": {
"description": "Optional whitelist of schemas (e.g., ['dbo','sales'])",
"items": {
"type": "string"
},
"type": "array"
},
"allowedTables": {
"description": "Optional whitelist of fully qualified tables (e.g., ['dbo.customer_dummy'])",
"items": {
"type": "string"
},
"type": "array"
},
"instruction": {
"description": "Natural language request to query MSSQL (Thai/English)",
"minLength": 1,
"type": "string"
},
"maxRows": {
"default": 10,
"description": "Max rows to return",
"maximum": 200,
"minimum": 1,
"type": "integer"
}
},
"required": [
"instruction"
],
"type": "object"
}