Skip to main content
Glama
esasiyun17

MSSQL-MCP

by esasiyun17

Run read-only SQL query

run_query

Execute a single read-only SELECT query against Microsoft SQL Server with validation, table allowlists, row limits, and timeouts to prevent writes.

Instructions

Execute a single read-only SELECT statement (WITH/CTE supported) against the database. Every query is validated first: exactly one statement, SELECT-only, no write/exec keywords, optional table allowlist. Results are truncated at the configured MAX_ROWS (reported via the "truncated" flag) and a query timeout applies. Rejected queries name the exact rule that was violated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single T-SQL SELECT statement (CTEs allowed)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses validation order, the destructive-operation prohibition, the allowlist restriction, MAX_ROWS truncation surfaced via a 'truncated' flag, a query timeout, and that rejections name the violated rule. These are exactly the behavioral traits an agent needs before invoking.

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?

Three sentences, each carrying distinct information (what it runs, how it's validated, what limits apply and how errors surface). Front-loaded with the core action and free of padding.

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 single-parameter read tool with no output schema, the description covers the safety profile, execution limits, truncation signaling, and error behavior. An agent has everything needed to call it correctly and interpret the result.

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?

There is only one parameter and schema coverage is 100%, so the schema already documents the SQL string. The description reinforces that it must be a single SELECT (CTE allowed) but adds no syntax or formatting detail beyond the schema, matching the baseline for full-coverage params.

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?

States a specific verb and resource (execute a read-only SELECT against the database) and marks scope (single statement, WITH/CTE supported). It is clearly distinguishable from the list/describe/sample siblings, which are narrower introspection tools.

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 validation rules (exactly one statement, SELECT-only, no write/exec keywords, optional allowlist) tell the agent what is acceptable input and imply when this tool is the right choice versus the narrow siblings. It stops short of explicitly naming those siblings or stating when to prefer them, so it is clear context rather than full routing guidance.

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