Skip to main content
Glama

diff

Compute a diff between two markdown documents or URL contents. Supports unified, hunks, or summary output with line, word, or section granularity.

Instructions

Compute a diff between two markdown bodies or two URL fetches.

Key parameters:

  • old: { url?, markdown?, content_hash? } — left-hand side. URL form reads from cache; cache miss returns a structured cache_miss error (no network re-fetch).

  • new: { url?, markdown? } — right-hand side. Same cache rules as old.

  • output: 'unified' (default, git-style patch) | 'hunks' (structured array) | 'summary' (line counts only).

  • granularity: 'line' (default) | 'word' | 'section'. Section walks H1/H2/H3 boundaries and tags each hunk with section_title.

Returns { changed, summary, unified_diff?|hunks?, truncated? }. summary always present (added/removed/modified lines + total_changed_chars). Above the 5000-line cap the engine emits truncated: true plus an approximate summary — never silently degrades.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newNoRight-hand side of the diff. Requires one of { url, markdown }.
oldNoLeft-hand side of the diff. Requires one of { url, markdown, content_hash }.
outputNoDiff output shape. unified=git-style patch, hunks=structured per-section, summary=counts only (added_lines / removed_lines / modified_lines / total_changed_chars where total_changed_chars = sum of added_line_chars + removed_line_chars across the LCS edit script). Default: unified.
granularityNoDiff granularity. line=per-line LCS (default). word=token-level LCS — hunks contain only the changed tokens, tighter than line for intra-line edits. section walks H1/H2/H3 boundaries.
Behavior5/5

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

Without annotations, the description fully discloses important behaviors: cache miss returns structured error, truncation at 5000 lines with explicit flag, and never silent degradation. Also explains return value structure and default behaviors.

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?

Well-structured with bullet points for key parameters and a clear explanation of return value. Every sentence provides necessary information without redundancy. Efficient yet comprehensive.

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 params with nested objects, enums, and multiple edge cases like caching and truncation) and no output schema, the description fully covers behavior, input options, and output structure. No gaps remain.

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

Parameters5/5

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

Schema coverage is 100% but the description significantly adds value: explains which fields are required, provides examples/hints for enums (e.g., 'unified (default, git-style patch)'), describes nested object constraints, and clarifies cache semantics 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?

Clearly states 'Compute a diff between two markdown bodies or two URL fetches', specifying the action, resource, and domain. Distinguishes effectively from sibling tools (fetch, search, etc.) which do not perform diffing.

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?

Provides detailed parameter explanations including cache behavior, output options, and granularity. While there is no explicit 'when to use' vs 'when not to', the context makes it clear for diffing tasks. Lacks direct comparison to alternatives.

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/KnockOutEZ/wigolo'

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