JSONPath Tool for MCPify

Surgically extract exactly what you need from massive JSON payloads. Reduce token usage with precise path-based data extraction.

How JSONPath Tool Works

Without JSONPath Tool

// Entire 37KB response sent to AI
{
  "users": [...500 users...],
  "metadata": {...},
  "analytics": {...},
  "debug": {...}
}
// AI must process everything
  • ❌ Thousands of tokens consumed
  • ❌ Slow response times
  • ❌ Risk of hallucination from noise
  • ❌ Higher API costs

With JSONPath Tool

// JSONPath: $.users[0:5].email
// Returns only:
[
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]"
]
  • ✅ A few dozen tokens used
  • ✅ Instant extraction
  • ✅ Clean, focused data

Powerful JSONPath Features

Advanced Path Expressions

Support for wildcards, recursive descent, array slicing, and filtering predicates.

$.store.book[?(@.price < 10)]

Conditional Filtering

Extract data based on complex conditions with comparison and logical operators.

$.users[?(@.role=="admin")]

Array Operations

Slice arrays, access by index, and extract ranges with Python-like syntax.

$.results[0:10:2]

Filter Functions

Filter with the built-in JSONPath functions: length, count, match, search and value.

$.items[?length(@.tags) > 2]

Nested Navigation

Navigate deeply nested structures with recursive descent and wildcards.

$..author

Pattern Matching

Match strings against regular expressions inside a filter.

$.users[[email protected] =~ /@example\.com$/].email

Real-World Examples

Extract Active User Emails

JSONPath Expression:

$.users[?(@.status=="active")].email

Names of Products Priced Over 100

JSONPath Expression:

$.products[?(@.price > 100)].name

Returns every match; in this sample catalog, five products cost over 100:

[
  "Premium Laptop",
  "Smart TV 65\"",
  "Gaming Console",
  "Drone Pro",
  "Studio Headphones"
]

Extract Nested Address Fields

JSONPath Expression:

$.customers[*].addresses[?(@.type=="billing")].city

Returns:

[
  "New York",
  "San Francisco",
  "Chicago",
  "Austin"
]

Easy Integration with MCPify

MCP Tool Definition

{
  "name": "nav___json_get_by_path",
  "description": "Extract values from a cached snapshot using a JSONPath expression",
  "inputSchema": {
    "type": "object",
    "properties": {
      "json": {
        "description": "JSON data, or the reference string from a previous '_ref' field"
      },
      "path": {
        "type": "string",
        "description": "JSONPath expression (e.g., $.users[*].email)"
      }
    },
    "required": ["json", "path"]
  }
}

Usage in AI Agent

// Step 1: Call the API tool. A large response comes back as a reference (_ref).
{ "name": "crm___list_contacts", "arguments": { "limit": 1000 } }

// Step 2: Extract only what you need
{ "name": "nav___json_get_by_path",
  "arguments": {
    "json": "<_ref from step 1>",
    "path": "$..contacts[?(@.subscribed==true)].email"
  } }

// Step 3: The agent works from the extracted emails, not 1000 full contacts

Start Extracting Smarter with JSONPath Tool

Reduce token usage and keep irrelevant data out of the model's context. Available to agents as nav___json_get_by_path.