data
Read, modify, or delete data in JSON, YAML, and TOML files to manage structured data configurations and settings.
Instructions
Get, set, or delete data in JSON, YAML, or TOML files.
Use when you need to get, set, or delete specific values or entire sections in a structured data file.
Output contract: Returns {"success": bool, "result": Any, "file": str, ...}. Side effects: Modifies file on disk if operation is 'set' or 'delete'. Failure modes: FileNotFoundError if file missing. ToolError if format disabled or invalid JSON.
Operations:
get: Retrieve data, schema, or structure
set: Update/create value at key_path (always writes to file)
delete: Remove key/element at key_path (always writes to file)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to file | |
| operation | Yes | Operation: 'get', 'set', or 'delete' | |
| key_path | No | Dot-separated key path (required for set/delete, optional for get) | |
| value | No | Value to set as JSON string (required for operation='set') | |
| value_type | No | How to interpret the value parameter for SET operations. 'string': treat value as literal string (no JSON parsing). 'number': parse value as JSON number. 'boolean': parse value as JSON boolean. 'null': set to null/None (value parameter ignored). 'json' or None (default): parse value as JSON (current behavior, maintains backward compatibility). | |
| data_type | No | Type for get: 'data' or 'schema' | data |
| return_type | No | Return type for get: 'keys' (structure) or 'all' (full data) | all |
| output_format | No | Output format | |
| cursor | No | Pagination cursor |