Skip to main content
Glama
mssql-readonly-mcp

mssql-readonly-mcp

by riyama46

run_query

Read-only

Execute a single read-only T-SQL SELECT (CTEs allowed) against SQL Server to answer data questions. Results are row-capped; a truncated flag means filter or aggregate instead of paging.

Instructions

Run one read-only T-SQL SELECT (CTEs allowed). Anything else is rejected. Results are capped at the server row limit; "truncated": true means there were more rows, so aggregate or filter instead of paging.

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": "run_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesA single SELECT statement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and destructiveHint=false, so safety is covered; the description goes further by disclosing the server row cap, the meaning of the 'truncated': true flag, and the rejection behavior for non-SELECT statements. Those are operational traits an agent cannot get from the annotations or schema alone.

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 short sentences, front-loaded with the core constraint and followed by the row-limit caveat. Every sentence carries information that affects how the agent calls or re-calls the tool; nothing 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 single-parameter read tool with no output schema, the definition covers what it accepts, what it refuses, and how to interpret truncation, which is exactly the information needed to invoke it correctly and react to its results.

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% and the single parameter is already documented as 'A single SELECT statement.' The description adds meaningful constraint detail — CTEs are permitted, other statement types are rejected — which sharpens how the agent must construct the sql value.

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 — run one read-only T-SQL SELECT — and immediately bounds the scope with 'CTEs allowed, anything else is rejected.' That precision distinguishes it from describe_table and list_tables, which are metadata readers rather than query executors.

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?

Gives clear acceptance criteria (single SELECT only) and practical guidance for handling large result sets — aggregate or filter rather than page. It does not explicitly name the sibling tools as alternatives for schema exploration, so guidance is strong but not fully comparative.

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