merge
Update specific fields in database records without affecting other data. Perform partial updates by modifying only the provided fields while preserving all other record information.
Instructions
Merge data into a specific record, updating only the specified fields.
This tool performs a partial update, only modifying the fields provided in the data parameter. All other fields remain unchanged. This is useful when you want to:
Update specific fields without affecting others
Add new fields to an existing record
Modify nested properties without replacing the entire object
Args: thing: The full record ID to merge data into in format "table:id" (e.g., "user:john") data: Dictionary containing only the fields to update. Examples: - {"email": "newemail@example.com"} - updates only email - {"profile": {"bio": "New bio"}} - updates nested field - {"tags": ["python", "mcp"]} - replaces the tags array
Returns: A dictionary containing: - success: Boolean indicating if merge was successful - data: The complete record after merging, with all fields - modified_fields: List of field names that were modified - error: Error message if merge failed (only present on failure)
Examples: >>> await merge("user:john", {"email": "john.new@example.com", "verified": true}) { "success": true, "data": {"id": "user:john", "name": "John Doe", "email": "john.new@example.com", "verified": true, "age": 30}, "modified_fields": ["email", "verified"] }
Note: This is equivalent to the 'patch' tool but uses object merging syntax instead of JSON Patch.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
data | Yes | ||
thing | Yes |