Skip to content
Connect an agent

Single tools

check_pattern

Check a pattern file before you publish it to an organisation or save it to import. It is a single tool of the MCP server and the HTTP API, with the title "Check pattern".

TL;DR

QuestionAnswer
What is it?A single tool: it does one thing.
What does it do?Check a pattern file before you publish it to an organisation or save it to import.
How do I call it over HTTP?POST /v1/patterns/check
Does it change anything?No. It is read-only and idempotent, and it talks to nothing outside itself. It saves no file and returns its answer as data.
Which bounds apply?None beyond the limits of each argument, which are in the schema 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

Check a pattern file before you publish it to an organisation or save it to import. A pattern is a diagram an organisation approves: fixed parts every team draws the same, and {{slot}} markers in quoted labels for what each team fills in. Start from get_pattern with file true. Returns every problem with its field and a fix, or each flavour filled with its defaults, to send to draw_diagram. Saves nothing.

Arguments

FieldTypeRequiredDescription
patternobjectyesThe pattern file. Every field is described at https://docs.plotwork.dev/schemas/plotwork.pattern.json (opens in a new tab); get_pattern with file true gives one to start from.
pattern.$schemastringno
pattern.namestringyes
pattern.titlestringyes
pattern.summarystringyes
pattern.whenToUsestringno
pattern.tagsstring[]no
pattern.templatesobjectyes
pattern.templates.neutralstringno
pattern.templates.awsstringno
pattern.templates.azurestringno
pattern.templates.gcpstringno
pattern.slotsobject[]no
pattern.slots[].idstringyes
pattern.slots[].defaultstringyes
pattern.slots[].meaningstringyes
pattern.notesobjectno
pattern.notes.keepstringno
pattern.notes.renamestringno
pattern.notes.splitstringno

Result

FieldTypeRequiredDescription
validbooleanyesTrue when the file passes every check a save runs, so publish_pattern or the portal's import would take it.
idstring | nullyesThe id it would have, org:; null when the name is not valid.
kindstring | nullyesThe kind of diagram every flavour draws; null when not valid.
flavours("neutral" | "aws" | "azure" | "gcp")[]yesThe flavours the file gives.
problemsobject[]yesEvery problem at once, each with its field and a fix. Empty when valid.
problems[].fieldstringyesWhere the problem is: name, title, templates.aws, slots.0.default, and so on; json for a file that is not JSON.
problems[].messagestringyes
problems[].hintstringyesHow to fix it.
sourcesobjectyesEach flavour filled with the slot defaults, keyed by flavour: send one to draw_diagram to see it and its warnings. Empty when not valid.
nextstringyesThe next step in one sentence.

Behavior hints

HintValue
readOnlyHinttrue
destructiveHintfalse
idempotentHinttrue
openWorldHintfalse

See also

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