Surgically extract exactly what you need from massive JSON payloads. Reduce token usage by up to 99% with precise path-based data extraction.
// Entire 37KB response sent to AI
{
"users": [...500 users...],
"metadata": {...},
"analytics": {...},
"debug": {...}
}
// AI must process everything// JSONPath: $.users[0:5].email // Returns only: [ "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]" ]
Support for wildcards, recursive descent, array slicing, and filtering predicates.
$.store.book[?(@.price < 10)]Extract data based on complex conditions with comparison and logical operators.
$.users[?(@.role=="admin")]Slice arrays, access by index, and extract ranges with Python-like syntax.
$.results[0:10:2]Validated extraction with type checking and error handling built-in.
$.items[*].price.number()Navigate deeply nested structures with recursive descent and wildcards.
$..authorApply string operations and transformations during extraction.
$.name.toLowerCase()JSONPath Expression:
$.users[?(@.status=="active")].email
Returns:
[ "[email protected]", "[email protected]", "[email protected]" ]
JSONPath Expression:
$.products[?(@.price > 100)][0:5].name
Returns:
[ "Premium Laptop", "Smart TV 65"", "Gaming Console", "Drone Pro", "Studio Headphones" ]
JSONPath Expression:
$.customers[*].addresses[?(@.type=="billing")].city
Returns:
[ "New York", "San Francisco", "Chicago", "Austin" ]
{
"tool": "json_get_by_path",
"description": "Extract data from JSON using JSONPath expressions",
"input_schema": {
"type": "object",
"properties": {
"ref": {
"type": "string",
"description": "Reference to cached API response"
},
"path": {
"type": "string",
"description": "JSONPath expression (e.g., $.users[*].email)"
},
"default": {
"description": "Default value if path not found",
"nullable": true
}
},
"required": ["ref", "path"]
},
"examples": [
{
"description": "Get all admin emails",
"input": {
"ref": "resp_123",
"path": "$.users[?(@.role=='admin')].email"
}
}
]
}// Step 1: Fetch API data (returns reference)
const response = await mcpify.call("crm.list_contacts", {
limit: 1000
});
// Step 2: Extract only what you need
const emails = await mcpify.call("json_get_by_path", {
ref: response.ref,
path: "$.contacts[?(@.subscribed==true)].email"
});
// Step 3: AI processes minimal, focused data
await agent.process({
task: "Send newsletter",
recipients: emails // Only 50 emails vs 1000 full contacts
});Reduce token usage by 99% and eliminate hallucination from irrelevant data. Available in every MCPify service.