Skip to main content
Glama
Andrian17

mssql-mcp-server

by Andrian17

mssql_execute_query

Run parameterized SELECT queries to retrieve, count, or verify data in SQL Server databases, with configurable row limits and timeouts.

Instructions

Execute SELECT queries and data retrieval operations - operation="select/count/exists" with query and optional parameters. Examples: operation="select", query="SELECT * FROM Users WHERE CreatedAt > @p1", parameters=["2024-01-01"]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of rows to return (safety limit; defaults to 10000 for select)
queryYesSQL SELECT query to execute
timeoutNoQuery timeout in milliseconds
operationYesQuery operation: select (fetch rows), count (count rows), exists (check existence)
parametersNoParameter values for placeholders (@p1, @p2, ... or $1, $2, ...)
connectionStringNoSQL Server connection string (optional; requires --allow-tool-connection-string)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the burden of disclosing behavior. It communicates that this is a read/retrieval tool and shows parameter binding via @p1, which is useful. However, it does not mention default row limits, timeout behavior, or explicit read-only guarantees beyond the word 'SELECT'.

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?

The description is a single focused sentence followed by a representative example. Every element earns its place, and the core purpose is front-loaded.

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?

The description plus schema covers the required inputs, operation modes, and example syntax adequately for a query tool. It does not explicitly differentiate from the similar sibling mssql_execute_sql, and there is no output schema, but the missing output information is inherently query-dependent.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds meaningful value by showing a concrete example with @p1 and clarifying the relationship between operation, query, and parameters, which helps an agent assemble valid calls.

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 opens with a specific action and resource: 'Execute SELECT queries and data retrieval operations', and further defines the allowed operation set (select/count/exists). This clearly distinguishes it from the mutation-oriented sibling mssql_execute_mutation.

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 stated scope (SELECT queries and data retrieval) gives a clear context for when to use this tool, and the example reinforces the intended pattern. It does not explicitly name alternatives or exclusion conditions, but the boundary is evident from the operation enum.

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