json_sample
Extract JSON data samples from specified arrays within files. Define path, array location, sample count, and method (first or random) to retrieve precise data segments efficiently.
Instructions
Sample JSON data from a JSON file. Requires maxBytes
parameter (default 10KB). Returns a random sample of data from the JSON file. The path must be within allowed directories.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
arrayPath | Yes | JSONPath expression to locate the target array (e.g., "$.items" or "$.data.records") | |
count | Yes | Number of elements to sample | |
maxBytes | Yes | Maximum bytes to read from the file. Must be a positive integer. Handler default: 10KB. | |
method | No | Sampling method - "first" for first N elements, "random" for random sampling | first |
path | Yes | Path to the JSON file containing the array |