Skip to main content
Glama
dataplat

dbatools-mcp-server

Official
by dataplat

invoke_dbatools_command

Destructive

Executes dbatools commands through PowerShell and returns structured JSON output, with confirmation safeguards for destructive or change operations.

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

NameRequiredDescriptionDefault
confirmNoSet to true to allow execution of change/destructive commands (required when safeMode is on)
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" } }
commandNameYesExact dbatools command name to execute, e.g. Get-DbaDatabase
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and readOnlyHint=false. The description adds substantial procedural safety context: it explains the confirm:true workflow, references DBATOOLS_SAFE_MODE, tells the agent to explain consequences before destructive commands, and requires showing the exact command and output for transparency.

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 front-loaded with its purpose and then provides safety guidance, which is appropriate for a dangerous generic executor. It is somewhat repetitive about confirmation and double-checking, but the redundancy is arguably justified by the destructive nature of the tool.

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?

For a generic execution wrapper with four parameters, full schema coverage, and explicit destructive/open-world annotations, the description is complete enough to call the tool safely. It omits explicit routing to sibling discovery/help tools, which is a minor contextual gap given that arbitrary dbatools command names and parameters must be known in advance.

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 schema already documents commandName, parameters, selectProperties, and confirm in detail. The description reinforces the confirm semantics and safe-mode condition but adds little about the other parameters or the nested parameter map beyond what the schema provides.

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

Purpose4/5

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

The description states a specific verb and resource: execute a dbatools command via PowerShell and return structured JSON. It is clearly the execution tool versus the sibling help/list/check tools, but it does not explicitly name those siblings or explain the division of labor.

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 gives clear operational context for when confirmation is required and strongly warns against running destructive commands without explicit user approval. It does not, however, mention when to use sibling tools such as list_dbatools_commands or get_dbatools_command_help before invoking a command.

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