Skip to main content
Glama
Heretek-RE

re-binary-diff

by Heretek-RE

unified_diff

Computes a unified diff between two files, using difflib for small files and SHA-256 chunk comparison for large ones. Returns structured diff output without modifying files.

Instructions

Compute a unified-style diff between path_a and path_b.

For small files (<= 8 MiB per side) the function runs difflib.unified_diff over the byte streams (decoded as latin-1). For large files it falls back to a per-chunk SHA-256 diff.

Args: path_a: first file (the "before" or "original") path_b: second file (the "after" or "patched")

Returns::

{
  "path_a": "...",
  "path_b": "...",
  "size_a": N,
  "size_b": N,
  "mode": "sha256_equal" | "inline_unified_diff" | "chunk_sha256_diff",
  "equal": bool,
  "diff_lines": ["...", ...],   (inline mode)
  "chunk_diff": [{...}, ...],   (chunk mode)
}

The function is read-only. The "patched" copy at path_b is not modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
path_aYes
path_bYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explicitly states the tool is read-only, describes the mode of operation (difflib vs chunk SHA-256), and outlines the return format. It could mention error handling but is sufficient for transparency.

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

Conciseness4/5

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

The description is detailed but every sentence adds value: main verb, algorithm, parameters, return format, read-only note. It could be slightly more concise, but it is well-structured and front-loaded with the key purpose.

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?

Given no output schema or annotations, the description covers purpose, algorithm, threshold, return format, and read-only nature. It is complete enough for an agent to select and invoke, though lacking examples or error conditions.

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 description coverage is 0%, so the description compensates by providing clear parameter semantics: path_a is 'before/original' and path_b is 'after/patched'. This adds meaning beyond the raw schema, though no additional constraints or formats are given.

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 the tool computes a unified-style diff between two files, specifies the algorithm (difflib for small, SHA-256 for large), and the return structure. It distinguishes itself from sibling tools by its specific focus on unified diff.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides usage context (small vs large files) but does not explicitly compare to sibling tools or state when to use this vs alternatives. Usage is implied by the description of what it does.

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/Heretek-RE/re-binary-diff'

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