Skip to main content
Glama
yangfeng20

dynamic-db-mcp-server

by yangfeng20

execute_sql

Execute SQL statements on registered database instances with automatic classification into read-only, destructive, or blocked operations, ensuring safety by requiring confirmation for destructive commands.

Instructions

Execute a SQL statement on a registered instance.

SQL is classified before execution:

  • Read-only (SELECT/SHOW/WITH/EXPLAIN/DESC): executes directly.

  • Destructive (DROP/DELETE/UPDATE/INSERT/ALTER/TRUNCATE/CREATE/...): requires confirm_destructive=true.

  • Blocked (OUTFILE/DUMPFILE/LOAD_FILE/SHUTDOWN/KILL): always rejected.

Args: instance_id: The instance name from register_instance. sql: The SQL statement to execute. database: Optional database to switch to before executing. confirm_destructive: Set to true to allow destructive operations.

Returns: JSON string with query results (columns/rows/row_count) or affected_rows for DML, or error/safety rejection details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
databaseNo
instance_idYes
confirm_destructiveNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Thoroughly describes SQL classification, execution rules, and return values. No annotations provided, so description carries full burden and succeeds.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with bullet points and clear sections. Some redundancy could be trimmed but overall efficient and front-loaded.

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?

Covers execution behavior, parameter roles, return types (JSON with columns/rows/affected_rows). With output schema existing, description is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema coverage, description explains all four parameters: instance_id, sql, database (optional), confirm_destructive. Adds value beyond schema structure.

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?

Clearly states tool executes a SQL statement on a registered instance, differentiating from read-only sibling tools. Lists specific operations and behavior.

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?

Provides explicit conditions for using confirm_destructive and notes blocked statements. Does not explicitly compare with siblings but context implies usage scope.

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/yangfeng20/dynamic-db-mcp-server'

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