Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

merge_json

Read-onlyIdempotent

Deep merge two JSON objects. Supports three array strategies: replace (default), concat, or unique (dedup concat). Nested objects are recursively merged — override takes precedence for primitives.

Input Schema

NameRequiredDescriptionDefault
baseYesThe base JSON object (merged into) — a JSON string, or the object itself.
overrideYesThe override JSON object (takes precedence) — a JSON string, or the object itself.
array_strategyNoArray merge strategy: replace (default), concat, or unique

Output Schema

NameRequiredDescriptionDefault
mergedNo
new_keysNo
total_keysNo
overridden_keysNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "base": {
      +      "a": {
      +        "x": 1,
      +        "y": 2
      +      }
      +    },
      +    "override": {
      +      "a": {
      +        "y": 3
      +      }
      +    }
      +  }
      +]
  2. Changed4 schema fields changed
    • changedInput schema / properties / base / description
      Previous value: -"Base JSON object (will be merged into)"New value: +"The base JSON object (merged into) — a JSON string, or the object itself."
    • changedInput schema / properties / base / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "object",
      +  "array"
      +]
    • changedInput schema / properties / override / description
      Previous value: -"Override JSON object (takes precedence)"New value: +"The override JSON object (takes precedence) — a JSON string, or the object itself."
    • changedInput schema / properties / override / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "object",
      +  "array"
      +]
  3. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "merged": {},
      +  "new_keys": {
      +    "type": "array"
      +  },
      +  "overridden_keys": {
      +    "type": "array"
      +  },
      +  "total_keys": {
      +    "type": "number"
      +  }
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds valuable merge semantics: recursive nested merging, override precedence for primitives, and three array strategies with 'replace' as the default. It stops short of describing error behavior for invalid JSON.

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?

Three compact sentences, front-loaded with the core action. Every sentence adds useful semantic detail with no repetition or filler.

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?

The tool is a pure merge utility with full schema coverage, clear annotations, and an output schema. The description covers the important merge and array-handling behavior an agent needs before calling it.

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?

Schema coverage is 100%, so the baseline is 3. The description still adds meaning beyond the schema by clarifying that nested objects are recursively merged and that override takes precedence for primitive values, plus that 'unique' means deduplicated concat.

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 states a specific verb and resource: 'Deep merge two JSON objects.' The operation is unambiguous and distinct from neighboring JSON utilities such as json_diff, flatten_json, and transform_json_array.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains mechanics but gives no explicit when-to-use guidance, prerequisites, or alternatives. It does not say when to choose merge_json over sibling JSON tools.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.