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.
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)
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"
}
}
}
}
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.
The endpoint merges exactly two objects per call. For multiple objects, chain calls or merge pairs sequentially through your MCP client.
Arrays are replaced entirely by the second object's array value, not concatenated or merged element-wise.
Pass your base config and override config as parameters. The MCP tool returns the merged result, perfect for environment-specific settings or feature flags.
Yes, all JSON data types (strings, numbers, booleans, arrays, objects, null) are preserved exactly in the merged output.