Skip to main content
Glama

Execute Write SQL

mysql_execute
Destructive

Execute write SQL statements such as INSERT, UPDATE, DELETE, and DDL on a MySQL database, with optional bind parameters and database selection.

Instructions

Execute a write SQL statement (INSERT, UPDATE, DELETE, DDL).

WARNING: This tool modifies data. Use with caution.

Args:

  • sql (string, required): SQL statement. Use ? placeholders for parameters.

  • params (array, optional): Bind parameters corresponding to ? placeholders.

  • database (string, optional): Database name. Uses MYSQL_DATABASE if omitted.

Returns: { affectedRows: number, insertId: number, changedRows: number }

Examples:

  • sql: "UPDATE biz_exhaust_hy SET DELETE_FLAG = 'DELETED' WHERE ID = ?", params: [123]

  • sql: "INSERT INTO my_table (name) VALUES (?)", params: ["test"]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesWrite SQL statement. Use ? for bind parameters.
paramsNoBind parameters for ? placeholders
databaseNoDatabase name (uses MYSQL_DATABASE env var if omitted)
Behavior5/5

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

Annotations already mark destructiveHint=true and readOnlyHint=false. The description adds a clear warning, return format details (affectedRows, insertId, changedRows), and examples. This fully discloses behavioral traits beyond annotations.

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 with a clear structure: purpose line, warning, args, returns, and examples. No superfluous text; every element adds value.

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?

No output schema exists, so the description must explain return values. It does so with the exact return object shape and concrete examples. Combined with annotations and input schema, the description is fully adequate for the tool's complexity.

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?

Schema coverage is 100%. The description adds usage semantics: using ? placeholders, optional bind params, and database fallback to env variable. This provides meaning beyond the schema's property descriptions.

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 explicitly states 'Execute a write SQL statement (INSERT, UPDATE, DELETE, DDL).' The verb 'Execute' and resource 'write SQL statement' are clear, and listing specific SQL types distinguishes it from read-only sibling tools like mysql_query.

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 warns 'This tool modifies data. Use with caution.' and implicitly separates its write-only purpose from read siblings. However, it lacks explicit guidance on when not to use or direct alternatives, so it's not a full 5.

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/donald-ada/mysql'

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