Skip to main content
Glama
teghoz

sql-mcp

by teghoz

execute_query

Execute read-only SELECT queries against SQL Server databases, with configurable row limits and database selection for controlled data retrieval.

Instructions

Execute a read-only SELECT query against the SQL Server. Only SELECT statements (and CTEs using WITH) are permitted. Use TOP or FETCH NEXT in your query for large tables to avoid excessive data transfer. Results are capped at 1000 rows by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SELECT query to execute
databaseNoDatabase to run the query against (defaults to the configured default database)
max_rowsNoMaximum number of rows to return (default: 1000, max: 5000)
Behavior4/5

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

With no annotations, the description takes on full disclosure duty. It explicitly states read-only, limits query types to SELECT/WITH, and mentions the default 1000-row cap. This covers the most critical safety and behavioral aspects, though it omits details like error handling or permissions.

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 earning its place: action, constraint, and performance tip. No redundancy or filler, and the most important information 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?

For a tool with 3 simple parameters and no output schema, the description adequately covers the key context: read-only nature, allowed query constructs, and result size limits. A minor gap is not describing the return format, but that is not critical for a query execution tool.

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 has 100% parameter coverage, giving a baseline of 3. The description adds the crucial semantic constraint that only SELECT/WITH statements are allowed, which is not present in the schema, and clarifies the default row cap behavior for max_rows. This meaningfully augments the schema descriptions.

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 clearly states the tool executes a read-only SELECT query against SQL Server, which is a specific verb+resource combination. It distinguishes itself from sibling metadata tools by being the only one that runs arbitrary queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides constraints (SELECT-only, row cap) and practical advice (TOP/FETCH), but does not explicitly say when to prefer this tool over sibling tools like list_tables or describe_table. The usage context is implied rather than stated with exclusions or alternatives.

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/teghoz/sql-mcp'

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