Skip to main content
Glama

Convert local XML and JSON

abox_xml_json

Converts XML to JSON or JSON to XML in local files using attribute, text, and repeated-child mappings, reporting lossy conversions while refusing ambiguous names, DTDs, and custom entities.

Instructions

Convert XML to JSON using @ attributes, #text and repeated-child arrays, or JSON to XML under a fixed root element. Verifies the exact existing source mapping, which is lossy: XML values are strings, mixed child/text order and comments can be lost, and JSON null/empty containers collapse. Refuses ambiguous name collisions, DTDs and custom entities. Contents remain in the local output. Requires no browser.

Input Schema

NameRequiredDescriptionDefault
indentNo2
directionYes
input_pathYesAbsolute local filesystem path. URLs and network shares are refused.
output_pathYesAbsolute local filesystem path. URLs and network shares are refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description discloses important behavioral traits: the mapping is lossy, XML values become strings, mixed child/text order and comments may be lost, JSON null/empty containers collapse, and certain inputs are refused. These are exactly the operational risks an agent needs to know before invoking the conversion.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core conversion purpose and then layers in important lossiness and refusal constraints. It is dense but appropriately sized, with no redundant or purely decorative sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a local file conversion tool with no output schema, the description covers the major behavioral concerns: mapping conventions, lossiness, refusals, and local output. It leaves minor gaps around output-file overwrite behavior and the indent parameter, but the overall context is sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds useful semantics for the direction parameter by explaining both conversion directions and their mapping behavior. However, it does not explain the indent parameter, and schema coverage is only 50%, so the description does not fully compensate for the undocumented parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource pair: converting XML to JSON or JSON to XML. It also distinguishes this conversion operation from formatting siblings by describing the mapping conventions (@ attributes, #text, repeated-child arrays) and fixed XML root behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly frames the tool as a local file conversion operation and states exclusions such as ambiguous name collisions, DTDs, custom entities, and browser use. It does not explicitly point to sibling alternatives like abox_xml_format or abox_json_format, so it falls short of full when-to-use-versus-alternative guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.