Skip to content
Connect an agent
Single tools

compare_diagrams

Compare two versions of a diagram by meaning, for a pull request review. It is a single tool of the MCP server and the HTTP API, with the title "Compare diagrams".

TL;DR

QuestionAnswer
What is it?A single tool: it does one thing.
What does it do?Compare two versions of a diagram by meaning, for a pull request review.
How do I call it over HTTP?POST /v1/diagrams/compare
Does it change anything?No. It is read-only and idempotent. It saves no file and returns its answer as data.
Which bounds apply?maxCompareChanges. See the bounds below.
Where do I read its schema as data?An MCP client gets the name, description, and JSON Schema of every tool from tools/list.

What it does

Compare two versions of a diagram by meaning, for a pull request review. Send before and after, each as source, the text of a Plotwork SVG that carries its source, or a cdn.plotwork.dev link. Returns every statement added, removed, renamed (by id or label), moved to another block, or changed (options, type, edge arrow or label), with counts and a plain-language summary; markdown true adds a block ready to paste as a comment. Reordered or reformatted lines are no change. A side with no source is reported, not an error. Lays nothing out; fetches only a link.

Arguments

FieldTypeRequiredDescription
beforestringyesThe old diagram: source, the text of a Plotwork SVG that carries its source, or a cdn.plotwork.dev link. at least 1 character; at most 1000000 characters.
afterstringyesThe new diagram, in any of the same three forms. at least 1 character; at most 1000000 characters.
markdownbooleannoAlso return a Markdown block ready to paste as a pull request comment. default false.

Result

FieldTypeRequiredDescription
samebooleanyes
beforeobjectyes
before.from"source" | "svg" | "url"yes
before.readbooleanyesFalse when no source could be read from it; message says why.
before.kindstring | nullyes
before.validbooleanyes
before.messagestring | nullyes
afterobjectyes
after.from"source" | "svg" | "url"yes
after.readbooleanyesFalse when no source could be read from it; message says why.
after.kindstring | nullyes
after.validbooleanyes
after.messagestring | nullyes
countsobjectyes
counts.addedintegeryes
counts.removedintegeryes
counts.renamedintegeryes
counts.movedintegeryes
counts.changedintegeryes
changesobject[]yes
changes[].change"added" | "removed" | "renamed" | "moved" | "changed"yes
changes[].subject"header" | "node" | "group" | "edge" | "row" | "series" | "line"yes
changes[].namestringyesThe id, the label in quotes, or for an edge its ends.
changes[].lineinteger | nullyesThe line in after, or in before for a removal.
changes[].detailstringyes
truncatedbooleanyesTrue when more changes were found than are listed; counts covers all of them.
summarystringyesThe changes in plain words, for a pull request review.
markdownstring | nullyes
nextstringyes

Behavior hints

HintValue
readOnlyHinttrue
destructiveHintfalse
idempotentHinttrue
openWorldHinttrue

Bounds

A bound that is reached is reported in the result; nothing is cut silently.

BoundValueWhat it limits
maxCompareChanges200Changes listed in one answer; counts and the summary cover every change.

See also

DocWhy
Tool referenceEvery tool, with the workflows first
POST /v1/diagrams/compareThe same operation over HTTP
Language referenceWhat the diagram source may contain
Writing diagrams with an agentThe loop in practice