Skip to main content
Glama
dataplat

dbatools-mcp-server

Official
by dataplat

invoke_dbatools_command

Run dbatools PowerShell commands for SQL Server administration, returning structured JSON output with safety confirmations for destructive actions.

Instructions

Execute a dbatools command via PowerShell and return structured JSON output.

SAFETY: For any destructive or change command (Remove, Drop, Disable, Reset, etc.), always explain the consequences to the user and ask for explicit confirmation before running. Only proceed with confirm:true if the user has clearly confirmed their intent. Respect DBATOOLS_SAFE_MODE: never bypass safety checks. For any command that modifies or deletes data, double-check with the user before proceeding. Show the exact command and output for transparency. Non-readonly commands require confirm:true when safe mode is enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandNameYesExact dbatools command name to execute, e.g. Get-DbaDatabase
parametersNoKey-value map of parameters. Strings, numbers, and booleans map directly to PowerShell parameters. For SQL authentication pass SqlCredential as an object: { "username": "sa", "password": "secret" }. Example: { "SqlInstance": "localhost,2022", "SqlCredential": { "username": "sa", "password": "P@ssw0rd" } }
confirmNoSet to true to allow execution of change/destructive commands (required when safeMode is on)
selectPropertiesNoList of property names to select from the output (e.g. ['Name', 'Status', 'SizeMB']). Use this to reduce output size for commands that return complex objects like SMO database or login objects. When omitted, all properties are returned.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It transparently explains safety behaviors: requiring user confirmation for destructive commands, respecting safe mode, and the need for confirm:true. It does not cover error handling or rate limits, but safety is well addressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a concise purpose statement followed by a necessary safety block. While the safety paragraph is somewhat long, it is essential and not redundant. Slight trimming possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and missing annotations, the description covers safety well and provides an example for the parameters parameter. It could be improved by describing the output structure or error behavior, but it is fairly complete for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description reinforces the confirm parameter's safety role but does not add new semantic meaning beyond the schema for other parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Execute a dbatools command via PowerShell and return structured JSON output.' This is a specific verb+resource combination that distinguishes it from sibling tools like check, get help, and list commands.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides detailed safety guidelines for using the tool, such as asking for confirmation for destructive commands and respecting safe mode. However, it lacks explicit guidance on when to use this tool versus alternative tools, though the sibling names imply execution is the role.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dataplat/dbatools-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server