Skip to main content
Glama
dkp5897

SQL Server MCP Server

by dkp5897

sql_run_query

Execute SELECT queries against a configured SQL Server database and retrieve formatted results, with automatic row limiting to keep output manageable for data inspection and debugging.

Instructions

Execute a SELECT query against the configured SQL Server database and return formatted results. Only SELECT statements are allowed here — for writes, use sql_run_write.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SELECT SQL query to execute
maxRowsNoMax rows to display (default: 500). Query will auto-add TOP N if not present.
Behavior3/5

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

No annotations provided, so the description carries the full burden but does add useful behavioral context: the read-only nature (SELECT only) and the maxRows auto-add TOP N behavior. It doesn't disclose return formatting details, error behavior, or performance considerations, but the core safety profile (read-only) is conveyed.

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?

Two concise sentences with zero waste. Front-loaded with the primary action, then immediately the critical constraint and alternative for writes. Every sentence earns its place.

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?

For a query execution tool with 2 fully-documented parameters and no output schema, the description adequately covers usage. It captures the key behavioral traits (SELECT-only, row limits). Minor gap: it doesn't mention whether results are tabular, JSON, or another format, though this is arguably minor for a simple query tool.

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 schema documents both parameters fully. The description adds the behavioral note that 'Query will auto-add TOP N if not present' for maxRows, which is slightly beyond the schema. Baseline 3 is appropriate since schema handles parameter documentation.

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?

Clear verb+resource: 'Execute a SELECT query against the configured SQL Server database and return formatted results.' It explicitly restricts to SELECT statements, distinguishing it from the write sibling (sql_run_write). Differentiates from inspection/analysis siblings by focusing on raw query execution.

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?

Explicitly states 'Only SELECT statements are allowed here — for writes, use sql_run_write.' This gives clear when-to-use vs when-not-to guidance with a named alternative. However, it doesn't discuss when to prefer this over other read tools like sql_find_data or sql_count_and_sample, though the read vs query distinction is largely self-evident.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dkp5897/sql-server-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server