json_extract
Extract specific data from JSON files using paths, filters, patterns, or slices to retrieve targeted values, filter by conditions, or transform JSON elements for focused analysis.
Instructions
Extract specific data using paths, filters, patterns, or slices from JSON files. Always use this tool when you need to retrieve particular values, filter arrays/objects by conditions, search for patterns, or slice data. Ideal for targeted data extraction, data transformation, and focused analysis of specific JSON elements.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
default_value | No | Fallback if path not found | |
end | No | Array slice end index | |
file_path | Yes | Path to the JSON file | |
filter | No | JS condition to filter results (e.g., 'item.age > 18') | |
keys | No | Specific object keys to extract | |
path | No | Dot notation path to target | |
pattern | No | Regex pattern to search for | |
search_type | No | What to search when using pattern | |
start | No | Array slice start index |
Input Schema (JSON Schema)
{
"properties": {
"default_value": {
"description": "Fallback if path not found"
},
"end": {
"description": "Array slice end index",
"type": "number"
},
"file_path": {
"description": "Path to the JSON file",
"type": "string"
},
"filter": {
"description": "JS condition to filter results (e.g., 'item.age > 18')",
"type": "string"
},
"keys": {
"description": "Specific object keys to extract",
"items": {
"type": "string"
},
"type": "array"
},
"path": {
"description": "Dot notation path to target",
"type": "string"
},
"pattern": {
"description": "Regex pattern to search for",
"type": "string"
},
"search_type": {
"description": "What to search when using pattern",
"enum": [
"key",
"value",
"both"
],
"type": "string"
},
"start": {
"description": "Array slice start index",
"type": "number"
}
},
"required": [
"file_path"
],
"type": "object"
}