Skip to main content
Glama

Convert data between formats

convert_data
Read-onlyIdempotent

Convert data between JSON, CSV and XML: json→csv (array of flat objects), csv→json (header line required), xml→json (attributes as @name, text as #text) and json→xml. Reports the position of syntax errors.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "data": "<data>",
      "from_format": "<from_format>",
      "to_format": "<to_format>"
    },
    "name": "convert_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe data as text: the JSON, CSV or XML document to convert.
prettyNoIndent XML output (default true).
delimiterNoCSV delimiter for csv→json.
to_formatYesTarget format.
from_formatYesFormat of data.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered by structured data. The description adds genuine behavioral value beyond that: error reporting ("Reports the position of syntax errors") and input preconditions (header line, flat-object arrays). It stops short of disclosing the response shape or what happens to partially malformed input.

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?

One dense sentence, front-loaded with the core action, then the supported conversions, then the error behavior. No filler, no repetition of the title beyond what is needed.

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?

With no output schema, the description does a reasonable job of signaling what comes back by mentioning syntax-error positions, and it covers input constraints. It is slightly thin on output shape (how converted data plus errors are combined) and on limits such as input size, but overall complete enough for a small pure-function converter.

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 every parameter (data, from_format, to_format, delimiter, pretty) is already documented, which sets the baseline at 3. The description adds only directional pairing semantics for from_format/to_format and the CSV header requirement; it says nothing about pretty or delimiter beyond what the schema states.

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 opens with a specific verb and resource ("Convert data between JSON, CSV and XML") and then enumerates the exact supported direction pairs (json→csv, csv→json, xml→json, json→xml). This makes it clearly distinct from siblings such as encode_text, inspect_json, or convert_time, which operate on different resources.

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 enumerated direction list implicitly tells an agent which conversions are supported and, by omission, which are not (e.g. csv→xml), plus a prerequisite for csv→json ("header line required") and a shape constraint for json→csv ("array of flat objects"). It does not, however, name any sibling tool or state explicitly when to prefer an alternative — but it does not need to, since validation/format inference fit naturally under this tool.

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.