Skip to main content
Glama

data_merge

Read-onlyIdempotent

Merge two configuration files (JSON, YAML, TOML) into one, with overlay values overriding base values. Supports format conversion and optional output file.

Instructions

Merge two files into a single deep-merged configuration.

Performs a deep merge where values from the second (overlay) file override or extend those in the first (base) file. If output_file is provided the merged result is written to that path; otherwise the merged content is returned in the response.

Parameters: file_path1 (str): Path to the base file. file_path2 (str): Path to the overlay file whose values override the base. output_format (str | None): Desired output format: "json", "yaml", or "toml". Defaults to the format of the first file. output_file (str | None): Optional path to write the merged output. When omitted, merged content is returned.

Returns: MergeResponse with "success", "file1", "file2", "output_format", and either "result" (merged content) or "output_file" (written path).

Raises: ToolError: If an input file is missing, its format is not enabled, the output format is invalid, or the merge fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_path1YesPath to first file (base)
file_path2YesPath to second file (overlay)
output_fileNoOptional output file path (if not provided, returns merged content)
output_formatNoOutput format (defaults to format of first file)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
file1No
file2No
resultNo
messageNo
successYes
output_fileNo
output_formatNo
Behavior5/5

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

The description fully discloses the deep merge behavior, override semantics, and output options (file vs. response). Annotations (readOnlyHint=true, idempotentHint=true, destructiveHint=false) are consistent and complemented by the description's details on return values and errors.

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 well-structured with a summary, detailed parameter list, return info, and error notes. It is concise yet comprehensive, using clear sections without unnecessary words.

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 tool's complexity (4 parameters, 2 required), full schema coverage, and presence of output schema, the description covers all necessary aspects: behavior, parameters, return values, and error conditions. No gaps identified.

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

Parameters4/5

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

Schema coverage is 100%, but the description adds meaning: it explains that file_path2 values override file_path1, clarifies default format behavior, and describes the conditional return structure. This adds value beyond the schema.

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 states it merges two files into a deep-merged configuration. It uses specific verbs ('Merge') and resources ('two files', 'deep-merged configuration'), distinguishing it from sibling tools like data_diff or data_convert.

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 explains the general usage (merge two files with overlay semantics). It does not explicitly state when not to use it or list alternatives, but the sibling tool names provide context that this is for merging, not diffing or converting.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bitflight-devops/mcp-json-yaml-toml'

If you have feedback or need assistance with the MCP directory API, please join our Discord server