> ## Documentation Index
> Fetch the complete documentation index at: https://iso-topology.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# An agent can discover, repair, and inspect its diagram

> A concrete agent workflow with seven MCP tools, structured feedback, source continuity, and visual verification.

iso-topology gives an agent the information needed for its **next action**: supported fields before writing, located diagnostics after validation, revised YAML after repair, and visual artifacts before delivery.

For measured task results, raw source/SVG artifacts and limitations, see the
[workflow evidence](https://iso-topology.mintlify.site/agent/evaluation.md).

## The complete loop

```mermaid theme={"system"}
flowchart LR
  A[Discover capabilities] --> B[Author YAML]
  B --> C[Validate and evaluate]
  C --> D[Repair supported defects]
  D --> E[Use returned DSL]
  E --> F[Render and inspect]
  F -->|Needs revision| B
  F --> G[Deliver SVG and source]
```

| Stage | MCP tool | Useful feedback |
| - | - | - |
| Discover | `iso_capabilities` | Shapes, primitives, fields, enums and themes from the engine. |
| Check | `iso_validate` | Issue severity, source path and suggestions where available. |
| Assess | `iso_evaluate` | Layout and composition observations to guide the next edit. |
| Revise | `iso_repair` | Repaired YAML, change status and fixes; inspect before accepting. |
| Render | `iso_render` | File paths for SVG, HTML preview and source copy. |
| See | `iso_snapshot` | PNG path for visual review; requires a rasterizer. |
| Focus | `iso_preview` | A selected node, group or edge as SVG. |

## Why this works well for agents

**A discoverable contract.** Query the running binary instead of guessing field names from an old example. The generated schema supports validation in other tools.

**Actionable feedback.** An issue can locate a field such as `nodes.scene.parts[2].shape` and suggest `cylinder`. Layout feedback describes geometric problems; the agent can revise a specific object.

**An editable result.** Source repair returns YAML that can become the next input. The text is suitable for review and version control. Keep IDs stable across iterations.

**A visual check.** A score cannot prove that a person will understand a diagram. Open the PNG, or use a local SVG viewer. Preview a crowded edge without repeatedly examining the entire scene.

**A local, reusable engine.** CLI, MCP and the Go library expose the drawing pipeline. The engine does not require an account. AI-client hosting and data handling are separate.

## The same loop from a terminal

Save the [starter YAML](../assets/first-diagram.yaml) as `input.yaml`, then run each stage and inspect its result:

```bash theme={"system"}
isotopo capabilities
isotopo validate input.yaml
isotopo evaluate input.yaml
isotopo repair input.yaml --compose --write
isotopo render --report input.yaml ./out
isotopo snapshot input.yaml ./out
isotopo preview input.yaml ./detail.svg api
```

`repair --write` changes the source; keep a baseline first. `validate` returns 0 for clean, 2 for warnings, and 3 for errors. Render warnings do not necessarily produce a nonzero exit code. Treat each command's contract separately.

## A reliable handoff

Return the editable source path, SVG path, and a brief account of what was checked. Include remaining warnings. When snapshot generation is unavailable, say so and keep the SVG available for human inspection.

### Continue after a human edit

Choose one authoring file, such as `diagrams/first-architecture/input.yaml`.
`topology.yaml` is an output copy, so keep the authoring path explicit in each handoff.

1. Let the human finish editing in Studio and confirm the saved file contains the change.
2. Read the authoring file from disk before the next tool call; do not reuse stale DSL from conversation history.
3. Validate and render the latest source, then inspect the exported SVG before returning it.

For example, if a human renames `API Gateway` to `Public API`, the next agent edit
should preserve that label while adding a cache. Saving in Studio updates the
source, while publishing the updated SVG requires another render.

Use the same engine revision, source and resources for reproducible output. External images, fonts, renderer revisions and PNG backends can affect results. Repair is bounded and preserves some explicit routing intent; it is not a global layout guarantee.

[Connect your first agent](https://iso-topology.mintlify.site/getting-started/00-onboarding.md) · [MCP arguments](https://iso-topology.mintlify.site/agent/MCP.md) · [CLI contracts](https://iso-topology.mintlify.site/reference/cli.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.