transform_json_array
Transform a JSON array using common operations: pluck (extract specific fields), filter (by field value), sort_by (field), group_by (field), count_by (field), uniq_by (field). Useful for processing MCP tool results and LLM structured outputs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | For first_n / last_n: number of items | |
| path | No | Optional dot-notation path to the array within the JSON object (e.g. "data.items") | |
| field | No | Field to operate on (for sort_by, group_by, count_by, uniq_by, filter) | |
| input | Yes | The JSON containing an array (or an object with an array at `path`) — a JSON string, or the value itself. | |
| fields | No | Comma-separated field list for "pluck" (e.g. "id,name,email") | |
| filter_op | No | For "filter": "==" | "!=" | ">" | ">=" | "<" | "<=" | "contains" | "exists" | "!exists" | |
| operation | Yes | Operation: "pluck", "filter", "sort_by", "group_by", "count_by", "uniq_by", "reverse", "first_n", "last_n", "flatten" | |
| sort_order | No | For sort_by: "asc" (default) or "desc" | |
| filter_value | No | For "filter": value to compare against |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| field | No | ||
| order | No | ||
| total | No | ||
| fields | No | ||
| result | No | ||
| removed | No | ||
| operation | No | ||
| group_count | No | ||
| unique_values | No | ||
| removed_duplicates | No |