Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

by berthojoris

repair_query

Read-onlyIdempotent

Diagnoses SQL query errors and suggests fixes for syntax, missing tables/columns, and logic issues; provide the failing query and optional error message to get repair recommendations.

Instructions

🔧 Diagnoses SQL query errors and suggests fixes. Analyzes syntax errors, missing columns/tables, and logic issues. Provide the query and optional error message to get repair recommendations. Use when a query fails or needs debugging.

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": {
      "query": "<query>"
    },
    "name": "repair_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe SQL query to analyze or repair
error_messageNoOptional error message received when executing the query

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.46.0

TDQS

A3.9/5.0
Behavior4/5

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

With readOnlyHint, idempotentHint, and destructiveHint=false already supplied, the description still adds useful behavioral context: it discloses the three analysis categories performed and that recommendations are returned rather than applied. It does not clarify whether a rewritten query is produced or only prose suggestions, which keeps it below 5.

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?

Four short sentences, front-loaded with the purpose before the usage cue, and every sentence contributes. The leading wrench emoji is decorative noise, a minor blemish on an otherwise tight definition.

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 two-parameter read-only tool with no output schema, the description covers what it does, what it inspects, and what it returns at a high level ('repair recommendations'). It is slightly thin on the shape of those recommendations, but nothing required for correct invocation is missing.

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 coverage is 100% and both parameters are already documented, including that error_message is optional. The description only restates 'optional error message' without explaining that supplying it materially improves diagnosis — marginal value beyond the schema, so the baseline 3 applies.

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?

The description uses a specific verb plus resource ('Diagnoses SQL query errors and suggests fixes') and enumerates the error classes handled: syntax errors, missing columns/tables, and logic issues. It is clearly a repair/diagnosis tool rather than a plain analyzer, though it never names the sibling analyze_query, so differentiation is inferred from the failure framing rather than stated.

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?

'Use when a query fails or needs debugging' gives a clear triggering condition, and 'Provide the query and optional error message' states the input expectation. There are no explicit exclusions or named alternatives (e.g., analyze_query for healthy queries), so it stops short of a 5.

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