execute_query
Run read-only SELECT queries on SQL Server databases to retrieve data with automatic row limits for safety and performance.
Instructions
Execute a read-only SQL query and return results.
Only SELECT statements are allowed. The query will have a row limit applied
automatically if not specified.
Args:
query: SQL SELECT statement to execute
max_rows: Maximum rows to return (overrides default, capped by MSSQL_MAX_ROWS)
Returns:
Dictionary with:
- query: The original query
- executed_query: The query that was actually executed (may include TOP)
- columns: List of column names
- rows: List of row dictionaries
- row_count: Number of rows returned
- max_rows: The effective row limit appliedInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||