Skip to main content
Glama
dbbroker-mcp
by natogalvez

query

Executes T-SQL against configured SQL Server connections, returning JSON result sets; reads roll back automatically, while writes require approval in the broker window before commit.

Instructions

Run SQL on a connection (today every connection is SQL Server: T-SQL).

  • Reads (SELECT/WITH...): run inside a transaction that is always rolled back.

  • Writes (INSERT/UPDATE/DELETE/MERGE/DDL/EXEC...): the user must approve them in the broker window (this may take a while). They are committed only if approved and successful. Returns JSON with one or more result sets: {columns, rows, truncated} or {rowcount}.

Args: sql: T-SQL batch (no GO). connection: connection name; omit for the default one (see list_connections). max_rows: maximum rows per result set (the broker enforces its own cap).

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": {
      "sql": "<sql>"
    },
    "name": "query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
max_rowsNo
connectionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: reads execute inside a transaction that is always rolled back, writes require approval in a broker window that may take a while, and writes commit only if approved and successful. It also discloses the return shape ({columns, rows, truncated} or {rowcount}), giving the agent latency, side-effect, and commit semantics it could not get from structured fields.

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

Conciseness5/5

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

Front-loaded with the capability, then immediately the read/write behavioral split, then a compact Args block. Bullets do real work and no sentence is filler.

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

Completeness5/5

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

For a high-risk arbitrary-SQL tool with no annotations, the definition covers execution model, approval flow, commit conditions, dialect, return shape, and every parameter. An output schema exists, yet the result-shape summary still adds clarity rather than redundancy.

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 description coverage is 0%, so the description must supply all parameter meaning, and it does: sql is a T-SQL batch with no GO, connection is a named target that can be omitted for the default (pointing at list_connections), and max_rows is a per-result-set cap that the broker may override. Each of the three parameters gains meaning that the bare schema does not provide.

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?

States a specific verb and resource ("Run SQL on a connection") and pins the dialect (T-SQL, SQL Server), so the agent knows exactly what executes. It does not explicitly differentiate itself from the sibling metadata tools (describe_table, list_tables, list_databases), so the agent must infer that this is the arbitrary-SQL escape hatch.

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

Usage Guidelines3/5

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

It documents the read vs. write split and cross-references list_connections for the connection parameter, which helps the agent decide how a call will behave. However, there is no explicit statement of when to prefer this tool over describe_table/list_tables for schema inspection, and no guidance on what to avoid.

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