app icon
Object Extractor Tool
0.3.1

Extract values from objects and arrays using JSONPath

cazziwork/object_extractor_tool185 installs

Object Extractor Tool

Overview

Object Extractor Tool is a Dify plugin that provides powerful JSONPath-based extraction capabilities for objects, arrays, and JSON strings. It automatically converts extracted values to appropriate types and provides type-safe outputs across multiple data types.

Features

  • JSONPath Support: Full JSONPath syntax support for complex data extraction
  • Automatic Type Conversion: Extracted values are automatically converted to the appropriate type
  • Multiple Data Types: Supports boolean, number, string, and array types (including array of objects)
  • Three Extraction Tools:
    • : Extract values from objects
    • : Extract values from arrays
    • : Parse and extract from JSON strings
  • Default Values: Returns sensible defaults when values are not found
  • Nested Path Support: Handle deeply nested objects and arrays

Tools

1. Extract Value from Object

Extract values from objects using JSONPath expressions.

Tool Name:

Parameters:

  • (required): The target object to extract from (object, array, or JSON string)
  • (required): JSONPath expression to extract the value

Example Usage:

Nested Object Example:

2. Extract Value from Array

Extract values from arrays using JSONPath expressions. The array can contain any type of elements (objects, strings, numbers, booleans, etc.).

Tool Name:

Parameters:

  • (required): The target array to extract from (array or JSON string)
  • (required): JSONPath expression to extract the value

Example Usage:

Array of Primitives:

Array of Nested Objects:

3. Extract from String

Parse a JSON string and extract values using JSONPath. This is particularly useful when working with HTTP responses or other string-based JSON data.

Tool Name:

Parameters:

  • (required): The JSON string to parse (can be escaped)
  • (required): JSONPath expression to extract the value

Example Usage:

Use Case: HTTP Response Processing

When using Dify's HTTP Request node, responses often come as strings. Use to parse and extract specific fields:

Output Schema

All three tools share the same output schema with automatic type conversion:

Output FieldTypeDescriptionDefault Value
booleanExtracted boolean value (if not set)
numberExtracted number value (if not set)
stringExtracted string value (empty string)
array[boolean]Extracted boolean array (empty array)
array[number]Extracted number array (empty array)
array[string]Extracted string array (empty array)
array[object]Extracted object array (empty array)
stringString representation of any extracted value (empty string)

How to Use Outputs:

  • The tool automatically places the extracted value in the appropriate typed output field
  • Use the specific type field (e.g., ) when you know the expected type
  • Use for generic string representation of any value
  • If a value is not found, each field returns its respective default value

Common Use Cases

1. API Response Processing

Extract specific fields from HTTP API responses:

2. Data Transformation Pipelines

Transform nested data structures by extracting specific values:

3. Array Processing

Process array elements in workflows:

4. Configuration Parsing

Extract configuration values from JSON strings:

JSONPath Syntax Reference

Common JSONPath patterns supported:

PatternDescriptionExample
Root element
Property access
Bracket notation
Array index
Array slice
Wildcard (all elements)
Recursive descent

Error Handling

  • Invalid JSONPath: Returns default values for all output types
  • Path Not Found: Returns default values based on the expected type
  • Invalid JSON String (string_extract only): Returns default values
  • Type Mismatch: Attempts automatic conversion; returns default on failure

Requirements

  • Python: 3.12 or higher
  • Dify Version: Compatible with Dify plugin system
  • Dependencies: jsonpath-ng (automatically installed)

License

See PRIVACY.md for privacy and licensing information.

Contributing

For bug reports or feature requests, please contact the author: cazziwork

Changelog

Version 0.2.0

  • Added tool for JSON string parsing
  • Enhanced type conversion and default value handling
  • Improved JSONPath support for complex nested structures
CATEGORY
Tool
VERSION
0.3.1
cazziwork·02/21/2026 06:15 AM
REQUIREMENTS
Maximum memory
256MB