JSON Utilities

Merge Json

Combines two JSON objects into a single merged object, handling nested properties and conflicts deterministically. Use via MCP in Cursor or Windsurf for AI-assisted data manipulation, or call GET /v1/json/merge with your objects. Perfect for configuration merging, API response combining, or template overlays. Preserves data types and structure integrity.

API Endpoint

GET /v1/json/merge

Code Examples

curl "https://tinyfn.io/v1/json/merge" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/merge', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/json/merge',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's json tools:

{
  "mcpServers": {
    "tinyfn-json": {
      "url": "https://tinyfn.io/mcp/json",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How does JSON merge handle conflicting keys between objects?

The second object's values take precedence over the first object's values for conflicting keys. Nested objects are merged recursively rather than completely replaced.

Can I merge more than two JSON objects at once?

The endpoint merges exactly two objects per call. For multiple objects, chain calls or merge pairs sequentially through your MCP client.

What happens when merging arrays in JSON objects?

Arrays are replaced entirely by the second object's array value, not concatenated or merged element-wise.

How do I use JSON merge with Claude Code for configuration files?

Pass your base config and override config as parameters. The MCP tool returns the merged result, perfect for environment-specific settings or feature flags.

Does JSON merge preserve data types like numbers and booleans?

Yes, all JSON data types (strings, numbers, booleans, arrays, objects, null) are preserved exactly in the merged output.

Try Merge Json Now

Get your free API key and start using Merge Json in seconds.

Get Free API Key