Skip to main content
Glama
bpamiri

SQL Server MCP

by bpamiri

validate_query

Validate SQL queries for safety and compliance before execution by checking statement types, blocked commands, read-only mode, and potential issues like missing WHERE clauses.

Instructions

Check if a query is safe to execute without running it.

Validates the query against:
- Statement type (SELECT, INSERT, UPDATE, DELETE, DDL, EXEC)
- Blocked commands list
- Read-only mode compliance
- Potential issues (missing WHERE clause, unbounded SELECT)

Args:
    query: SQL statement to validate

Returns:
    Dictionary with:
    - query: The original query
    - valid: Whether the query is valid
    - statement_type: Type of SQL statement
    - warnings: List of warning messages
    - suggestions: List of suggested improvements
    - error: Error message if invalid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it's a validation-only tool (doesn't run queries), checks against specific criteria (statement type, blocked commands, read-only compliance, potential issues), and returns structured results. It doesn't mention rate limits or auth needs, but covers core behavior adequately.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by bullet points for validation criteria and clear sections for Args and Returns. Every sentence adds value without redundancy.

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?

Given the tool's complexity (validation logic), no annotations, and an output schema that documents return values, the description is complete: it explains purpose, usage, validation criteria, parameter meaning, and return structure, covering all necessary aspects without needing to duplicate output schema details.

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?

With 0% schema description coverage and 1 parameter, the description compensates by explaining the 'query' parameter as 'SQL statement to validate', adding meaning beyond the schema's basic type. It doesn't detail format constraints, but provides essential context.

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's purpose with specific verbs ('check', 'validate') and resource ('query'), distinguishing it from siblings like execute_query or read_rows. It explicitly mentions what validation entails without being tautological.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('to check if a query is safe to execute without running it'), distinguishing it from execute_query and other siblings that run queries. It implies usage before execution to avoid unsafe operations.

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/bpamiri/pymssql-mcp'

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