Skip to main content
Glama
huang-develop

SQLServer MCP Server

execute_query

Execute any SQL statement (SELECT, INSERT, UPDATE, DELETE, DDL) with named parameters. Returns query results or affected row count for non-query statements.

Instructions

执行任意 SQL 语句(SELECT/INSERT/UPDATE/DELETE/DDL 等)。支持命名参数:SQL 中写 @name,params 传 { name: value }(键不需要 @ 前缀)。SELECT 返回行数据,非查询语句返回受影响行数。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes要执行的 SQL 语句
paramsNo命名参数,例如 { name: "张三", age: 30 }
maxRowsNoSELECT 最多返回行数,默认 500
timeoutNo超时毫秒数,默认 60000
databaseNo目标数据库名,默认当前连接数据库
Behavior3/5

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

With no annotations, the description carries the full burden of disclosure. It does explain return value behavior (rows for SELECT, affected row count for non-query) and the named parameter syntax, which is useful. However, it fails to warn about the destructive nature of DELETE/UPDATE/DDL statements, does not mention permissions or transactionality, and omits any note about irreversibility or safety measures.

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 three short sentences, each earning its place: purpose, parameter syntax, and return behavior. It is front-loaded with the core action and avoids any redundant filler.

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 general SQL executor, the description adequately covers what it does, parameter usage, and return semantics. Given the complexity of arbitrary SQL, it would be more complete with safety warnings or transaction behavior, but the essentials for invoking the tool are present. The schema already provides parameter details, so the description need not repeat them.

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?

The input schema covers all 5 parameters (100% coverage), but the description adds critical usage semantics beyond the schema: the @name convention in SQL and the corresponding key format in params (no @ prefix). It also clarifies the return behavior of SELECT vs. non-query statements, which is not stated in the schema. This adds meaningful 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?

The description begins with '执行任意 SQL 语句' (execute arbitrary SQL statements) and lists statement types (SELECT/INSERT/UPDATE/DELETE/DDL), making the tool's role crystal clear. This general-purpose executor is clearly distinguished from sibling tools like list_databases or describe_table, which handle metadata and connection operations.

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 purpose is unambiguous: this tool runs arbitrary SQL, implying it is for direct database manipulation. However, it does not explicitly mention when to prefer execute_script over this tool, nor does it state exclusions like 'use list_tables for schema metadata'. The context is clear but lacks explicit alternatives or when-not-to-use guidance.

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/huang-develop/SQLServer-MCP'

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