Skip to main content
Glama

XML a JSON

xml-parse
Read-onlyIdempotent

Convierte XML a JSON (atributos @nombre, texto #text, hijos repetidos como arreglos). Rechaza DTD y entidades. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: convertir un subconjunto seguro de YAML a JSON (yaml-parse). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Parses XML into JSON: attributes as @name, text as #text (or a plain string for text-only elements), repeated children as arrays. DTDs and custom entities are rejected (no XXE or entity expansion). When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: parsing a safe YAML subset (yaml-parse). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
xmlYesXML text (string; required).

Output Schema

NameRequiredDescriptionDefault
valueNoany JSON value

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / xml / examples
      Added value: +[
      +  "<?xml version=\"1.0\"?><note id=\"7\"><to>Ana</to><to>Bob</to><body>Hi &amp; bye</body><empty/></note>"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Parses XML into JSON: attributes as @name, text as #text (or a plain string for text-only elements), repeated children as arrays. DTDs and custom entities are rejected (no XXE or entity expansion). When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: parsing a safe YAML subset (yaml-parse). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the provided annotations, the description specifies critical operational behaviors: rejection of DTD/entities (security context), deterministic nature, and hard constraints on input/output size and execution time. These add significant value beyond the structured metadata.

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?

While verbose, the description is perfectly structured and highly efficient; every sentence serves a distinct, valuable function for an AI agent making a decision.

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

Completeness5/5

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

Given the single parameter and the complexity of the conversion process, the description is complete. It covers transformation rules, error handling/limits, and identity (deterministic) sufficiently to require no external lookup.

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 schema coverage is 100%, which sets a high baseline for parameter definition. While the description confirms the input is 'XML text (string; required)', it does not add complex semantic meaning that wasn't already covered by the schema or the surrounding text, justifying the baseline score.

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 clearly and specifically states the function as 'Parses XML into JSON' and details the structural mapping rules (attributes as @name, children as arrays). It successfully differentiates itself by explicitly stating it is not a YAML parser.

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

Usage Guidelines5/5

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

It provides a detailed 'When' and 'Not for' section. It contrasts itself against a specific sibling tool (yaml-parse) and defines the exact context (structured data transformation) in which it should be utilized.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources