Skip to main content
Glama

Get per-story diff detail with image URLs

get_diff
Read-only

Per-story diff detail for a build (resolved by commitSha/prNumber/buildId). Returns diff metrics and presigned, time-limited URLs (download them to a file, or link them in a PR comment) for the baseline, candidate, and diff PNGs. Defaults to the changed stories; pass storyId for one specific story. When that storyId is an UNCHANGED story it returns its baseline (diffResultId null, changed false, the baseline URL as both baselineUrl and candidateUrl) - the story rendered identical to baseline. Use render_diff_image instead when you want the actual pixels inline for a vision model, not a URL. When AI review is on, each diff carries the judge's call: aiVerdict (intended|regression), aiConfidence, aiSummary (what changed), aiReasoning, and aiFlagReason; all null when AI review didn't run for it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdNoResolve this exact build id.
storyIdNoLimit to one story id.
prNumberNoResolve the latest build for this PR number.
commitShaNoResolve the build for this git commit SHA.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffsYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Before
      null
      After
      {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "properties": {
          "diffs": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "aiConfidence": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "aiFlagReason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "aiReasoning": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "aiSummary": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "aiVerdict": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "baselineUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "browser": {
                  "type": "string"
                },
                "candidateUrl": {
                  "type": "string"
                },
                "changed": {
                  "type": "boolean"
                },
                "decision": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "diffResultId": {
                  "anyOf": [
                    {
                      "format": "uuid",
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "diffUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "metrics": {
                  "additionalProperties": false,
                  "properties": {
                    "bbox": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "height": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number"
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "changedPct": {
                      "type": "number"
                    },
                    "changedPx": {
                      "type": "number"
                    },
                    "changedPxAdjusted": {
                      "type": "number"
                    },
                    "flakinessPx": {
                      "type": "number"
                    },
                    "flakinessScore": {
                      "type": "number"
                    },
                    "hadBaseline": {
                      "type": "boolean"
                    },
                    "height": {
                      "type": "number"
                    },
                    "sizeChanged": {
                      "type": "boolean"
                    },
                    "threshold": {
                      "type": "number"
                    },
                    "width": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "storyId": {
                  "type": "string"
                },
                "viewport": {
                  "type": "string"
                }
              },
              "required": [
                "diffResultId",
                "storyId",
                "viewport",
                "browser",
                "changed",
                "decision",
                "metrics",
                "baselineUrl",
                "candidateUrl",
                "diffUrl",
                "aiSummary",
                "aiVerdict",
                "aiConfidence",
                "aiReasoning",
                "aiFlagReason"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "diffs"
        ],
        "type": "object"
      }
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses time-limited URLs, the unchanged-story edge case (diffResultId null, changed false, baseline URL repeated), and AI review fields being null when not run. This is substantial behavioral context that helps the agent understand responses.

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 dense but each sentence adds value: purpose, URL behavior, defaults, unchanged story behavior, alternative tool, and AI review output. It is front-loaded with the core purpose. Slightly long, but justified by the number of edge cases and output details.

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 output schema exists and covers the return shape, the description does not need to restate return values. It covers the main behaviors, edge cases, parameter roles, and alternative routing. For a read-only diff retrieval tool with multiple resolution options, this is complete enough for an agent to call it correctly.

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%, but the description adds semantic meaning: it explains how the three resolution identifiers (commitSha/prNumber/buildId) select a build, and what happens when a storyId corresponds to an unchanged story. It does not specify precedence if multiple identifiers are passed, but this is a minor gap.

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 a specific action and resource: returns per-story diff detail for a build resolved by commitSha/prNumber/buildId, including diff metrics and presigned URLs for baseline, candidate, and diff PNGs. It also distinguishes itself from render_diff_image by noting when that sibling is preferred.

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?

Explicitly describes when to use the tool: defaults to changed stories, pass storyId for a specific story, and contains an explicit exclusion: 'Use render_diff_image instead when you want the actual pixels inline for a vision model, not a URL.' This gives clear selection 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.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool targets a distinct concern: list vs get vs pagination, build triage vs PR changeset, diff URL vs inline pixels, single-review vs bulk-accept. The descriptions explicitly call out the differences between similar-sounding tools, so an agent can reliably choose the right one.

Naming Consistency5/5

All tool names follow a consistent lowercase verb_noun pattern: get_* for single entities, list_* for collections, and review_diff/accept_build for actions. There are no mixed conventions or vague verbs.

Tool Count5/5

Nine tools fit the visual regression review workflow well: discovery, triage, pagination, image inspection, and reviewing. Each tool fills a distinct role without redundancy, and the count is in the sweet spot for an agent to keep all tool purposes in context.

Completeness5/5

The surface covers the full review lifecycle: find builds, triage changed/failed/unchanged stories, paginate, inspect diffs as URLs or inline images, review per-diff, and bulk-accept an entire build. The PR-changeset tools also cover cross-PR questions and deletion cases that would otherwise be dead ends.

Resources