Skip to content
Connect an agent
Workflows

get_pattern

Returns one pattern filled for a flavour: its valid Plotwork source, every slot with its meaning and value, the advice on what to keep, rename, and split, and the structure as groups, overlays, and nodes. It is a workflow of the MCP server and the HTTP API, with the title "Get pattern".

TL;DR

QuestionAnswer
What is it?A workflow: one call does the work of several tools and returns one combined answer.
What does it do?Returns one pattern filled for a flavour: its valid Plotwork source, every slot with its meaning and value, the advice on what to keep, rename, and split, and the structure as groups, overlays, and nodes.
What does it replace?searching for an example and copying it by hand.
How do I call it over HTTP?POST /v1/patterns/get
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?maxPatternSlots. 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

Workflow. Returns one pattern filled for a flavour: its valid Plotwork source, every slot with its meaning and value, the advice on what to keep, rename, and split, and the structure as groups, overlays, and nodes. Send the id from find_pattern, a provider (neutral by default, or aws, azure, gcp), and optionally slot values such as {"office": "Branch office"} to name its parts. Edit the source for anything a slot does not cover, then validate it. An unknown id, flavour, or slot, or a value with a quote in it, comes back as a problem with a fix, not as an error. Replaces searching for an example and copying it by hand.

Steps

OperationRunsWhat it does
fillPatternalwaysFill one pattern for one flavour with slot values: its source, slots, notes, group tree, and outline.

One call performs at most 1 operations.

Example call

The arguments of the call, as JSON:

json
{  "id": "three-tier-network",  "provider": "azure",  "slots": {    "office": "Branch office"  }}

Prompts that lead to it

  • Show me the three-tier network pattern for Azure and rename the office network to Branch office.
  • What can I change in the two-zone network pattern?

Arguments

FieldTypeRequiredDescription
idstringyesThe pattern id, as find_pattern returns it, such as three-tier-network. at least 1 character; at most 60 characters.
provider"neutral" | "aws" | "azure" | "gcp"noneutral (generic glyphs, no vendor names; the default), or aws, azure, or gcp for that provider's icons. Not every pattern comes in every flavour; the answer lists the ones it has. default "neutral".
slotsobjectnoSlot values keyed by slot id, such as {"office": "Branch office"}: plain text of up to 60 characters, no quotes or line breaks. Omit a slot to keep its default. get_pattern lists the slots and what they mean.

Result

FieldTypeRequiredDescription
foundbooleanyesTrue when the pattern and flavour exist and the slot values are usable. When false, problems says why and nothing else is filled.
idstringyesThe pattern id that was asked for.
titlestring | nullyes
patternSummarystring | nullyesOne sentence: what the pattern shows.
whenToUsestring | nullyes
kindstring | nullyes
flavour"neutral" | "aws" | "azure" | "gcp" | nullyesThe flavour that was filled.
flavours("neutral" | "aws" | "azure" | "gcp")[]yesEvery flavour this pattern comes in; empty when the pattern was not found.
sourcestring | nullyesPlotwork source, valid and ready to use; null when not found.
slotsobject[]yesEvery slot the source uses, with the value it has.
slots[].idstringyesThe slot id; the key to use in slots.
slots[].valuestringyesThe text the slot has in the source: the value sent, or the default.
slots[].defaultstringyesThe default text.
slots[].meaningstringyesWhat belongs in this slot.
slots[].isDefaultbooleanyesTrue when the slot kept its default.
notesobject | nullyesHow to adapt the pattern: what to keep, what to rename, and when to split.
problemsobject[]yesMistakes in the id, the flavour, or the slot values, each with a fix. Empty when found.
problems[].code"unknown-pattern" | "unknown-flavour" | "unknown-slot" | "bad-slot-value" | "bad-source"yes
problems[].messagestringyes
problems[].hintstringyesHow to fix it.
treeobject[]yesThe groups, overlays, and nodes as drawn, depth first, so you can see what to rename.
tree[].depthintegeryesHow deep the item sits: 0 for the top level.
tree[].kind"group" | "overlay" | "node" | "actor" | "table"yes
tree[].idstringyesThe id written in the source.
tree[].labelstringyes
tree[].typestring | nullyesThe group type, node type, or actor type; null for a table or an untyped group.
outlinestring[]yesThe text description of the diagram.
nextstringyesThe next step in one sentence.

Behavior hints

HintValue
readOnlyHinttrue
destructiveHintfalse
idempotentHinttrue
openWorldHintfalse

Bounds

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

BoundValueWhat it limits
maxPatternSlots40Slot values in one call; draw_from_pattern takes the same.

See also

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