Skip to main content
Glama

run-sqlcmd

Destructive

Executes a single sqlcmd batch against a specified SQL Server instance, locally or via SSH, WinRM, or a container, with timeouts and confirmation for emergency operations.

Instructions

dbabrain common.cli run-sqlcmd: One sqlcmd batch, and where to run it. Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line. Request fields (pass them as request):

  • sql (required): The batch.

  • instance (required): The -S sqlcmd connects to, as the host running it sees it.

  • sqlcmd_path: The sqlcmd to run (default sqlcmd).

  • container: The container the SQL Server runs in: its own sqlcmd runs the batch (docker exec), for a host with no sqlcmd of its own. ssh or local only.

  • username: A SQL login. With password; give neither for -E.

  • password: Its RESOLVED value. stdin only.

  • login_timeout_seconds: sqlcmd -l (default 30).

  • query_timeout_seconds: sqlcmd -t; 0 = none.

  • timeout_seconds: The whole run; 0 = none. Past it, the answer says timed_out.

  • via: local | ssh (a Linux host) | winrm (a Windows host, through a local Invoke-Command).

  • host: ssh / winrm: host, port, username, a RESOLVED password or key_file, open_timeout_seconds.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run-sqlcmd"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, and the description is consistent with them by warning "Changes or removes something." It adds genuine operational context beyond the annotations: the emergency-operations confirmation requirement (`confirm: "yes"` plus `reason`), a whole-run timeout that reports `timed_out`, and passwords accepted on stdin only. However, it omits what happens on partial batch failure, whether the batch runs in a transaction, and how errors are surfaced.

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 purpose is front-loaded and the bulk is a compact bulleted field list, so almost every line carries information. The prose is telegraphic to the point of fragmentation ("Changes or removes something.", "ssh or local only."), which costs a little readability but avoids padding.

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 destructive, open-world remote-execution tool the description covers transport choice, authentication mode, timeouts, and the confirmation gate, which is what an agent needs before calling it. It is slightly incomplete in that the `confirm`/`reason` fields used by the emergency-operations path are never listed in the request field enumeration, and no output schema details are referenced (acceptable, since one exists).

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

Parameters5/5

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

Schema coverage is 0% — the input schema exposes only an opaque `request` object with no property documentation — so the description carries the full burden, and it does: it names each request field, maps them to sqlcmd flags (-S, -l, -t), supplies defaults (sqlcmd, 30s), states the -E case as "give neither" username nor password, and marks password as a RESOLVED value delivered on stdin. Minor gaps remain (`confirm` and `reason` are referenced but not listed among the fields, and the `host` sub-fields are given as a bare noun list).

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 first line gives a concrete verb and resource: "One sqlcmd batch, and where to run it", plus an explicit mutation warning. It is clear what the tool does, though it never explicitly distinguishes itself from the adjacent run-sql / run-sql-write siblings, leaving the agent to infer that this one executes a raw sqlcmd batch against an instance reachable locally, via ssh, or via winrm.

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

Usage Guidelines2/5

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

There is no statement of when to pick this over run-sql, run-sql-write, or run-cmd, nor any exclusions. The only conditional guidance is parameter-level (use `container` for a host with no sqlcmd of its own, "ssh or local only"), which tells the agent how to configure the call but not when the call is the right choice.

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

Deploy Server

Other Tools