Skip to main content
Glama

execute_sql

Read-only

Execute validated, read-only SQL on Azure SQL Database with row limits and static analysis for safe data retrieval.

Instructions

Execute statically validated, row-capped read-only SQL. The query may be preceded by DECLARE @var and SET @var = ... statements, followed by exactly one SELECT. DML, DDL, dynamic SQL, and stored procedure execution are always rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesRead-only SQL to execute.
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond annotations (which already indicate read-only and non-destructive), the description adds significant behavioral details: statically validated, row-capped, allowed DECLARE/SET prefixes, exactly one SELECT, and rejection of non-read-only constructs. This enriches the agent's understanding of invocation behavior.

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 concise—two sentences—and front-loaded with the primary action, followed by critical constraints. Every sentence contributes valuable information without redundancy, achieving an optimal length.

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 (SQL execution with validation and constraints), the description is complete for an agent to understand its capabilities and limitations. It covers allowed SQL forms, rejected operations, and row capping. Since an output schema exists, return values do not need elaboration.

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?

While the schema already describes both parameters (sql and database_name), the description adds semantic nuance about the sql parameter by specifying the accepted query structure (optional DECLARE/SET followed by exactly one SELECT). This goes beyond the schema's 'Read-only SQL to execute' and aids correct usage.

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 'Execute statically validated, row-capped read-only SQL', specifying the verb 'execute' and the resource 'SQL' with explicit constraints. It distinguishes itself from sibling tools by emphasizing read-only, row-capped execution, which is unique among the listed tools.

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 description provides clear context that this tool is for read-only SQL execution and explicitly lists what is rejected (DML, DDL, dynamic SQL, stored procedures). However, it does not name alternative tools or offer explicit 'when to use vs. alternatives' guidance, though the exclusions imply when not to use it.

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

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