switch_database
Change the active database context in SQL Server using the USE statement to execute queries against different databases.
Instructions
Switch the active database context.
Changes the current database using the USE statement. The database must
exist, be online, and not be in the blocklist (MSSQL_BLOCKED_DATABASES).
Args:
database_name: Name of the database to switch to
Returns:
Dictionary with:
- status: "switched" on success, "error" on failure
- database: The new active database name
- previous_database: The previously active database
- error: Error message if switch failed
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": {
"database_name": "<database_name>"
},
"name": "switch_database"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||