Skip to main content
Glama

text_merge

Read-only

Three-way merge (diff3) — Three-way line merge like git merge-file: base= (common ancestor), ours= and theirs= (a=/b= also accepted). Non-overlapping changes from both sides are combined; identical changes count once; overlapping different changes become conflicts with git-style markers (style=merge, diff3 with the base section, or zdiff3 which moves shared lines out of the conflict; ours_label/theirs_label/base_label). favor=ours|theirs|union resolves conflicts automatically. ignore_whitespace=true compares lines ignoring spacing. Returns merged text, clean flag, conflict count, per-conflict details with 1-based line ranges and the three versions, and stats on where changes came from. CRLF and trailing newline preserved. Max 300,000 characters and 20,000 lines per input. Price: $0.002 USDC (Base, via x402).

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": {
      "base": "<base>",
      "ours": "<ours>",
      "theirs": "<theirs>"
    },
    "name": "text_merge"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseYesalpha beta gamma
oursYesALPHA beta gamma
theirsYesalpha beta GAMMA

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld/non-destructive, and the description adds substantial cost-bearing context: hard input limits (300,000 chars, 20,000 lines), the x402 USDC micro-payment, CRLF/trailing-newline preservation, and exactly how conflicts are represented and resolved. It also describes the response shape (merged text, clean flag, conflict count, per-conflict ranges, stats), which annotations cannot supply.

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?

A single dense paragraph that front-loads the operation and then layers in options, conflict behavior, and limits in descending order of importance. Every clause carries information; nothing is redundant with the title or schema.

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 tool with an output schema absent, the description adequately covers return values, limits, pricing, and edge-case behavior (conflict markers, whitespace, line endings). The one completeness gap is that the described option parameters are not reflected in the schema, leaving uncertainty about which are actually accepted.

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%, and the schema's descriptions are merely example values, so the description carries real weight by explaining what base/ours/theirs mean and by defining semantics for style, favor, labels, and whitespace handling. However, it advertises parameters (style, favor, ours_label, theirs_label, base_label, ignore_whitespace) that do not exist in the input schema, which could lead an agent to pass arguments that would fail validation.

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?

The description opens with a specific verb+resource ("Three-way merge (diff3)") and anchors it with a concrete analogy ("like git merge-file"), which makes the operation unambiguous. It clearly separates itself from a plain two-way diff by emphasizing base/ours/theirs, but it never names a sibling tool such as text_diff as the alternative for two-way comparison.

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 sets out clear usage conditions: it is a three-way merge requiring a common ancestor, and it enumerates the behavioral modes (favor=, style=, ignore_whitespace=) that select different outcomes. It stops short of explicit when-not guidance or pointing to a sibling tool for the simpler two-way case.

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