Skip to main content
Glama

data_merge

Merge two configuration files by overlaying values from the second file onto the first, supporting JSON, YAML, and TOML formats with deep merging capabilities.

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: dict: A payload describing the merge. On success includes "success": True, "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_formatNoOutput format (defaults to format of first file)
output_fileNoOptional output file path (if not provided, returns merged content)

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