Skip to main content
Glama
neverinfamous

MySQL MCP Server

MySQL JSON Merge

mysql_json_merge
Read-only

Merge two JSON documents in memory using patch (RFC 7396) or preserve (array merge) mode.

Instructions

Merge two JSON documents using JSON_MERGE_PATCH or JSON_MERGE_PRESERVE.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc1NoAlias for json1
doc2NoAlias for json2
modeNoMerge mode: patch (RFC 7396) or preserve (array merge)
json1NoFirst JSON document. Note: This tool merges two raw JSON documents in-memory. It does NOT update database tables. Use mysql_json_update or mysql_json_set to update a table.
json2NoSecond JSON document
patchNoAlias for json2
sourceNoAlias for json2
targetNoAlias for json1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoError code (e.g. VALIDATION_ERROR, QUERY_ERROR)
dataNo
errorNoError message if operation failed
detailsNoAdditional error context
metricsNoToken estimation metrics
successYesWhether the operation succeeded
categoryNoError category (validation, query, connection, internal)
suggestionNoSuggested fix for the error
recoverableNoWhether the error is recoverable
Behavior4/5

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

Annotations (readOnlyHint=true, destructiveHint=false) indicate read-only behavior. The description adds behavioral context: it performs an in-memory merge, not a database operation. No contradiction with annotations.

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?

The main description is one concise sentence that captures core purpose. Parameter descriptions are detailed without being verbose. Could be slightly more structured (e.g., separating mode options), but front-loaded enough.

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?

Given the existence of an output schema (not shown but stated) and many sibling JSON tools, the description adequately covers the tool's function, differentiation, and key behavioral details. It is complete for a simple merge utility.

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?

All 8 parameters have descriptions (100% coverage). The description adds value by explaining aliases (doc1, doc2, patch, source, target) and clarifying that json1 is for in-memory merge only, not table updates. This goes beyond the schema.

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?

Title and description clearly state the tool merges two JSON documents using JSON_MERGE_PATCH or JSON_MERGE_PRESERVE. Differentiates from siblings like mysql_json_insert and mysql_json_set by explicitly noting it does not update database tables.

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?

Description includes explicit guidance: 'It does NOT update database tables. Use mysql_json_update or mysql_json_set to update a table.' This helps the agent avoid misuse. The mode parameter and its description further clarify when to use patch vs preserve, though could be more explicit about use cases.

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/neverinfamous/mysql-mcp'

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