# get_pattern

> Page: https://docs.plotwork.dev/mcp/tools/get-pattern. Index of every page: https://docs.plotwork.dev/llms.txt

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

| Question | Answer |
|---|---|
| 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`](https://docs.plotwork.dev/api/post-v1-patterns-get.md) |
| 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

| Operation | Runs | What it does |
|---|---|---|
| `fillPattern` | always | Fill 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

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | yes | The 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"` | no | neutral (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". |
| `slots` | `object` | no | Slot 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

| Field | Type | Required | Description |
|---|---|---|---|
| `found` | `boolean` | yes | True when the pattern and flavour exist and the slot values are usable. When false, problems says why and nothing else is filled. |
| `id` | `string` | yes | The pattern id that was asked for. |
| `title` | `string \| null` | yes |  |
| `patternSummary` | `string \| null` | yes | One sentence: what the pattern shows. |
| `whenToUse` | `string \| null` | yes |  |
| `kind` | `string \| null` | yes |  |
| `flavour` | `"neutral" \| "aws" \| "azure" \| "gcp" \| null` | yes | The flavour that was filled. |
| `flavours` | `("neutral" \| "aws" \| "azure" \| "gcp")[]` | yes | Every flavour this pattern comes in; empty when the pattern was not found. |
| `source` | `string \| null` | yes | Plotwork source, valid and ready to use; null when not found. |
| `slots` | `object[]` | yes | Every slot the source uses, with the value it has. |
| `slots[].id` | `string` | yes | The slot id; the key to use in slots. |
| `slots[].value` | `string` | yes | The text the slot has in the source: the value sent, or the default. |
| `slots[].default` | `string` | yes | The default text. |
| `slots[].meaning` | `string` | yes | What belongs in this slot. |
| `slots[].isDefault` | `boolean` | yes | True when the slot kept its default. |
| `notes` | `object \| null` | yes | How to adapt the pattern: what to keep, what to rename, and when to split. |
| `problems` | `object[]` | yes | Mistakes 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[].message` | `string` | yes |  |
| `problems[].hint` | `string` | yes | How to fix it. |
| `tree` | `object[]` | yes | The groups, overlays, and nodes as drawn, depth first, so you can see what to rename. |
| `tree[].depth` | `integer` | yes | How deep the item sits: 0 for the top level. |
| `tree[].kind` | `"group" \| "overlay" \| "node" \| "actor" \| "table"` | yes |  |
| `tree[].id` | `string` | yes | The id written in the source. |
| `tree[].label` | `string` | yes |  |
| `tree[].type` | `string \| null` | yes | The group type, node type, or actor type; null for a table or an untyped group. |
| `outline` | `string[]` | yes | The text description of the diagram. |
| `next` | `string` | yes | The next step in one sentence. |

## Behavior hints

| Hint | Value |
|---|---|
| `readOnlyHint` | true |
| `destructiveHint` | false |
| `idempotentHint` | true |
| `openWorldHint` | false |

## Bounds

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

| Bound | Value | What it limits |
|---|---|---|
| `maxPatternSlots` | 40 | Slot values in one call; draw_from_pattern takes the same. |

## See also

| Doc | Why |
|---|---|
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | Every tool, with the workflows first |
| [`POST /v1/patterns/get`](https://docs.plotwork.dev/api/post-v1-patterns-get.md) | The same operation over HTTP |
| [Language reference](https://docs.plotwork.dev/reference/language.md) | What the diagram source may contain |
| [Writing diagrams with an agent](https://docs.plotwork.dev/mcp/agent-loop.md) | The loop in practice |
