json_search_kv
Search key-value pairs in JSON files within a directory, filtering by specified key and optional value. Supports recursive search, match types, and customizable parameters for file size, depth, and results.
Instructions
Search for key-value pairs in JSON files within a directory. Requires maxBytes
(default 10KB), maxDepth
(default 2), and maxResults
(default 10) parameters. Returns all key-value pairs that match the search pattern. The path must be within allowed directories.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
directoryPath | Yes | Directory to search in | |
key | Yes | Key to search for | |
matchType | No | How to match values - only applies if value is provided | exact |
maxBytes | Yes | Maximum bytes to read from each file. Must be a positive integer. Handler default: 10KB. | |
maxDepth | Yes | Maximum directory depth to search. Must be a positive integer. Handler default: 2. | |
maxResults | Yes | Maximum number of results to return. Must be a positive integer. Handler default: 10. | |
recursive | No | Whether to search recursively in subdirectories | |
value | No | Optional value to match against the key |