Skip to main content
Glama
Secure MySQL MCP Server

Secure MySQL MCP Server

by Kavi-200312

write_query

Executes INSERT, UPDATE, DELETE, or DDL statements atomically, running immediately when policy permits or returning a pending approval request for review.

Instructions

Execute a write statement (INSERT, UPDATE, DELETE, or DDL). If the operation is configured for auto-approval in policy, it executes immediately in an atomic transaction; otherwise, it returns a pending approval request.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "write_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesThe SQL statement to execute.
paramsNoOptional query parameters.
databaseNoOptional database name.
userConfirmedNoSet to true if user has explicitly confirmed execution in chat.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose the non-obvious core behavior: policy-driven auto-approval, atomic transaction execution, and a pending-approval return path when policy does not permit immediate execution. It omits permissions requirements, reversibility/rollback semantics, and what the pending approval payload looks like, which keeps it short of a 5.

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?

Two sentences, both load-bearing: the first defines the operation and its scope, the second defines the outcome branch. The primary capability is front-loaded and there is no 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 destructive write tool with no annotations and no output schema, the description covers the essential execution model and the two possible result states. The one real gap is the shape of the 'pending approval request' return, which with no output schema must be inferred.

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

Parameters3/5

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

Schema description coverage is 100%, so all four parameters including sql, params, database, and userConfirmed are already documented in the schema. The description adds no parameter-level meaning beyond that baseline, notably nothing about how userConfirmed interacts with the auto-approval policy described in the prose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Execute a write statement') and enumerates the covered statement classes (INSERT, UPDATE, DELETE, DDL), which clearly separates it from read-oriented siblings. It never names propose_write or execute_approved_write, so differentiation from those two mutation siblings is left to inference.

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?

The two-branch outcome (auto-approved execution vs. pending approval) implicitly tells the agent this is the entry point for writes rather than the approval-confirmation tool, which is useful routing context. However, there is no explicit 'use this when…, use execute_approved_write when…' statement or any exclusion, so an agent must infer the boundary from behavior alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.