execute_query
Execute read-only SELECT queries against SQL Server databases, with configurable row limits and database selection for controlled data retrieval.
Instructions
Execute a read-only SELECT query against the SQL Server. Only SELECT statements (and CTEs using WITH) are permitted. Use TOP or FETCH NEXT in your query for large tables to avoid excessive data transfer. Results are capped at 1000 rows by default.
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": {
"query": "<query>"
},
"name": "execute_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SELECT query to execute | |
| database | No | Database to run the query against (defaults to the configured default database) | |
| max_rows | No | Maximum number of rows to return (default: 1000, max: 5000) |