xml_to_json_string
Convert XML files to JSON strings directly for quick content inspection without file creation. Specify input path and max bytes to read. Supports optional XML parsing settings like preserving property order.
Instructions
Convert an XML file to a JSON string and return it directly. This is useful for quickly inspecting XML content as JSON without creating a new file. Requires maxBytes
parameter (default 10KB). Uses fast-xml-parser for conversion. The input path must be within allowed directories. This tool is fully functional in both readonly and write modes (respecting maxBytes) since it only reads the XML file and returns the parsed data.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
maxBytes | Yes | Maximum bytes to read from the XML file. Must be a positive integer. Handler default: 10KB. | |
options | No | ||
xmlPath | Yes | Path to the XML file to convert |