# check_pattern

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

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

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

| Field | Type | Required | Description |
|---|---|---|---|
| `pattern` | `object` | yes | The pattern file. Every field is described at https://docs.plotwork.dev/schemas/plotwork.pattern.json; get_pattern with file true gives one to start from. |
| `pattern.$schema` | `string` | no |  |
| `pattern.name` | `string` | yes |  |
| `pattern.title` | `string` | yes |  |
| `pattern.summary` | `string` | yes |  |
| `pattern.whenToUse` | `string` | no |  |
| `pattern.tags` | `string[]` | no |  |
| `pattern.templates` | `object` | yes |  |
| `pattern.templates.neutral` | `string` | no |  |
| `pattern.templates.aws` | `string` | no |  |
| `pattern.templates.azure` | `string` | no |  |
| `pattern.templates.gcp` | `string` | no |  |
| `pattern.slots` | `object[]` | no |  |
| `pattern.slots[].id` | `string` | yes |  |
| `pattern.slots[].default` | `string` | yes |  |
| `pattern.slots[].meaning` | `string` | yes |  |
| `pattern.notes` | `object` | no |  |
| `pattern.notes.keep` | `string` | no |  |
| `pattern.notes.rename` | `string` | no |  |
| `pattern.notes.split` | `string` | no |  |

## Result

| Field | Type | Required | Description |
|---|---|---|---|
| `valid` | `boolean` | yes | True when the file passes every check a save runs, so publish_pattern or the portal's import would take it. |
| `id` | `string \| null` | yes | The id it would have, org:<name>; null when the name is not valid. |
| `kind` | `string \| null` | yes | The kind of diagram every flavour draws; null when not valid. |
| `flavours` | `("neutral" \| "aws" \| "azure" \| "gcp")[]` | yes | The flavours the file gives. |
| `problems` | `object[]` | yes | Every problem at once, each with its field and a fix. Empty when valid. |
| `problems[].field` | `string` | yes | Where the problem is: name, title, templates.aws, slots.0.default, and so on; json for a file that is not JSON. |
| `problems[].message` | `string` | yes |  |
| `problems[].hint` | `string` | yes | How to fix it. |
| `sources` | `object` | yes | Each flavour filled with the slot defaults, keyed by flavour: send one to draw_diagram to see it and its warnings. Empty when not valid. |
| `next` | `string` | yes | The next step in one sentence. |

## Behavior hints

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

## See also

| Doc | Why |
|---|---|
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | Every tool, with the workflows first |
| [`POST /v1/patterns/check`](https://docs.plotwork.dev/api/post-v1-patterns-check.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 |
