Skip to main content
Glama

Diferencias por línea

diff-lines
Read-onlyIdempotent

Calcula las diferencias por líneas entre dos textos en formato unificado, con conteo de líneas añadidas y eliminadas. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: calcular un JSON Patch (json-diff-patch). 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: Computes the line-based diff of two texts using longest common subsequence; returns a unified diff with configurable context and counts of added/removed lines. Changed-region product capped at 4M lines². When: text has to be transformed, compared or measured exactly instead of approximated. Not for: computing an RFC 6902 JSON Patch that transforms document a into document b (json-diff-patch). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
aYesOriginal text (string; required).
bYesNew text (string; required).
contextNoContext lines (integer; optional; default 3; min 0; max 20).

Output Schema

NameRequiredDescriptionDefault
addedNo
removedNo
unifiedNo
identicalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / a / examples
      Added value: +[
      +  "a\nb\nc"
      +]
    • addedInput schema / properties / b / examples
      Added value: +[
      +  "a\nB\nc"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Computes the line-based diff of two texts using longest common subsequence; returns a unified diff with configurable context and counts of added/removed lines. Changed-region product capped at 4M lines². When: text has to be transformed, compared or measured exactly instead of approximated. Not for: computing an RFC 6902 JSON Patch that transforms document a into document b (json-diff-patch). 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.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, yet the description still adds real context: determinism, no network, no stored state, a 1 s per-call timeout, a 1 MB result cap and the 4M lines² changed-region cap. One flaw: it advertises "JSON input up to 64 KB" while the schema allows 500,000 characters per string, so the stated limit is internally inconsistent with the structured data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core English sentences are well front-loaded and each earns its place, but the full Spanish mirror plus the meta-leak "[EN completo / full EN: inputSchema.description]" roughly doubles the length without adding information. The two language blocks are also not perfectly parallel (4M lines² cap appears only in EN).

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 an output schema present, the description need not explain return values, and it still summarizes the unified-diff + counts shape; limits and determinism round it out. The only gap is the size-limit mismatch against the schema's maxLength, which could mislead an agent about how much text it may submit.

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%, so the baseline is 3; the description goes slightly beyond by explaining that the diff is a unified diff with *configurable context*, which gives meaning to the `context` parameter that the schema's terse "Context lines" does not. It does not clarify that `a` is the original and `b` the new side beyond what the schema already says.

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?

States a specific verb+resource (line-based diff of two texts), names the algorithm (LCS), and specifies the output shape (unified diff with context and added/removed counts). It also explicitly distinguishes itself from the nearest sibling, json-diff-patch, so an agent can choose without opening either schema.

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?

Contains explicit "When" (exact transform/compare/measure, not approximation) and "Not for" clauses that name the alternative tool (json-diff-patch) and the condition that selects it. This is the strongest form of routing guidance.

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