Skip to main content
Glama

XML format / minify / validate / to JSON

xml_format
Read-onlyIdempotent

Validate, pretty-print, minify, or convert XML to JSON, with line/column errors and optional comment removal; accepts inline text or a file path.

Instructions

Validate XML (well-formedness and namespaces, with line and column for errors), pretty-print it (2, 4 spaces or tab; mixed content, CDATA and xml:space="preserve" kept exactly as written), minify it, or convert it to JSON (attributes as "@name", repeated elements as arrays, text as "#text"). Optionally removes comments. Never loads external DTDs or entities. Give "text" or a file "path". Web version: https://s3eidat.github.io/xml-format/

Input Schema

NameRequiredDescriptionDefault
modeNo"format" pretty-prints, "minify" strips layout whitespace, "json" converts to JSON, "validate" only checks (never throws on bad XML).format
pathNoOr: a path to a XML file (UTF-8; use this for big inputs).
textNoThe XML as inline text.
indentNoIndentation: 2, 4, "tab" (or any number of spaces 0-8).2
outputNoOptional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file.
removeCommentsNoDrop <!-- comments --> (format and minify).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Goes beyond the readOnly/idempotent annotations with real behavioral detail: no external DTD or entity loading (a meaningful side-effect guarantee), fidelity guarantees that mixed content, CDATA and xml:space="preserve" are kept as written, and that validation errors carry line/column. It does not say what validate returns on success or how large outputs are handled in the reply, but the added context is substantial.

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

Conciseness4/5

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

Front-loaded with the four modes and their distinguishing behavior, then input guidance. Dense but every clause carries information; the trailing web-version URL is the only low-value element.

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 6-parameter tool with no output schema and readOnly annotations, the description covers modes, input sources, preservation behavior, and safety limits. Remaining gaps (success return shape for each mode, behavior on invalid XML in non-validate modes) are modest and partly covered by the schema's 'validate never throws' note.

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?

Schema description coverage is 100%, so all six parameters are already documented in the schema, which sets the baseline at 3. The description adds little parameter-level meaning beyond restating the indent options and input source; the '@name'/array/'#text' notes describe JSON conversion output conventions rather than parameter behavior.

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

Purpose4/5

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

Specific verbs and resource: validate (with well-formedness/namespace checks), pretty-print, minify, convert to JSON — an agent immediately knows the four modes. It does not name xml_query, the closest sibling that also operates on XML, so the boundary between 'format' and 'query' work is left implicit. Still clearly distinguishable from html_format/json_format by the XML resource.

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

Usage Guidelines3/5

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

It gives input guidance ('Give "text" or a file "path"') and mode-level semantics, so usage is implied rather than stated. There is no explicit when-to-use/when-not guidance and no pointer to xml_query for query-type work. Adequate but leaves the agent to infer tool selection.

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

Deploy Server

Other Tools