-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Add targeted JSON modification tools to complement the existing token-saving read functions. Enable precise updates without loading/rewriting entire structures.
Motivation
We have 10 JSON inspection/reading tools (get_json_value_at_path, filter_json_array, etc.) but no targeted modification tools. Agents often need to update specific values, append to arrays, or merge objects without loading entire JSON structures.
Proposed Functions
High Priority - Targeted Updates
update_json_value_at_path- Update single value at path without full load (with skip_confirm)delete_json_key_at_path- Remove specific key at path (with skip_confirm)append_to_json_array- Add item to array at path (with skip_confirm)
Medium Priority - Structural Operations
merge_json_objects- Deep merge multiple JSON objectssort_json_array- Sort array by key (in-place or return new)flatten_json_object- Flatten nested object to single level with dot-notation keysunflatten_json_object- Expand flat object with dot-notation keys to nested structure
Lower Priority - Bulk Operations
transform_json_values- Apply transformation function to values matching criteriadeduplicate_json_array- Remove duplicate items from array
Design Principles
- Google ADK compliant (JSON-serializable types, no defaults)
- @strands_tool decorator
- Include skip_confirm parameter for destructive operations
- Use dot notation for path access (consistent with get_json_value_at_path)
- Return operation feedback strings
- Memory-efficient where possible
Related
- Complements existing data/json_tools.py read functions
- Related to issue Data: Future Enhancement Features #57 (Data Future Enhancements)
- Similar confirmation pattern to write_json_file
Module
data/json_tools.py
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request