Skip to main content
Glama

render_diff

Render a git diff as a syntax-highlighted image showing additions in green and deletions in red. Use for sharing code changes or reviewing pull requests.

Instructions

Render a git unified diff as a beautiful syntax-highlighted image (SVG or PNG). Shows additions in green and deletions in red with diff markers.

Perfect for PR reviews, sharing code changes on mobile, or visualising what changed between two versions.

Accepts standard git diff output (unified format). Automatically parses @@ hunk headers and renders additions/deltions with appropriate backgrounds.

The output is SVG by default. Set output_format='png' for a raster image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffYesThe unified diff content (e.g. output of `git diff` or `git show`). Should include @@ hunk headers and +/- markers.
themeNoColor theme namegithub-dark
titleNoOptional title shown in a window title bar
show_line_numbersNoShow line numbers in the gutter
font_sizeNoFont size in pixels
output_formatNoOutput format. 'svg' or 'png'.svg
paddingNoPadding around the code block in pixels
Behavior4/5

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

No annotations provided, so description bears full burden. Describes input format (standard git diff output), parsing of @@ hunk headers, and color coding. Lacks details on error handling or non-XSS, but overall transparent.

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?

Well-structured with clear front-loaded purpose. Slightly verbose, and contains a typo ('deltions' instead of 'deletions'), but overall concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Explains inputs well, but missing details on output (e.g., whether result is a URL, base64, or file). No output schema, so description should cover this.

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

Parameters3/5

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

Schema coverage is 100% with descriptions. Description adds minor context (e.g., diff structure, output_format='png' shorthand) but does not significantly augment 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 verb ('Render') and specific resource ('git unified diff as a beautiful syntax-highlighted image (SVG or PNG)'). Distinguishes from sibling 'render_code' by focusing on diffs.

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 explicit use cases ('PR reviews, sharing code changes on mobile, visualising changes'). Does not exclude alternatives, but context is clear.

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/thesimonharms/code-shot'

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