Skip to main content
Glama
cvelasquez

mcp-sqlserver

query

Run a SQL query against a SQL Server instance using a named connection, with configurable output format and row limits.

Instructions

Execute a SQL query on the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to execute
formatNoOutput format (default json). csv is far more compact for wide or long results: the first line is a JSON header with metadata, then the rows as CSV.
maxRowsNoMaximum rows to return across all result sets (default 1000, max 10000). When the cap is hit the query is cancelled on the server and the response starts with truncated: true. A truncated result is incomplete and the total row count is unknown: never report the cap as the number of rows. Prefer TOP, WHERE or aggregates over raising this.
connectionYesConnection name to use

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.1.0
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "Output format (default json). csv is far more compact for wide or long results: the first line is a JSON header with metadata, then the rows as CSV.",
      +  "enum": [
      +    "json",
      +    "csv"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / maxRows
      Added value: +{
      +  "description": "Maximum rows to return across all result sets (default 1000, max 10000). When the cap is hit the query is cancelled on the server and the response starts with truncated: true. A truncated result is incomplete and the total row count is unknown: never report the cap as the number of rows. Prefer TOP, WHERE or aggregates over raising this.",
      +  "maximum": 10000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. First observedv3.0.0

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations provided, the description carries the full behavioral disclosure burden, but it only says 'Execute a SQL query on the database.' It does not disclose that executing SQL may modify data, require permissions, cancel when row limits are hit, or return multiple result sets. The schema does include maxRows cancellation details, but that is structured field information, not behavior disclosed by the description.

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

Conciseness3/5

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

The description is a single sentence with no wasted words, which is concise. However, it is so minimal that it provides little structural benefit; it front-loads a generic action but omits any useful qualifiers or context. It is not a well-structured information-bearing description.

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

Completeness2/5

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

For a tool that executes arbitrary SQL and has no output schema, the description is incomplete. It does not mention connection requirements, supported formats, row limits, cancellation behavior, or whether the tool can perform writes. The schema fills some gaps, but the overall description leaves an agent without enough context to invoke the tool confidently and interpret its behavior.

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 itself adds no parameter-level meaning beyond what the schema already provides for connection, sql, format, and maxRows. It does not enrich or clarify any parameter semantics.

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 SQL query on the database.' This clearly identifies the tool's function and distinguishes it from the sibling metadata tools like get_schema and get_indexes. However, it does not explicitly address whether arbitrary read/write SQL is allowed, so it is clear but not fully differentiated in terms of scope.

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?

No usage guidance is provided. The description does not state when to use this tool instead of siblings such as get_schema, get_execution_plan, or list_connections, nor does it mention prerequisites like needing an existing connection. The intended selection logic is left entirely to inference.

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