---
name: "xpay-plantuml-generate-plantuml-diagram"
description: "Generate a PlantUML diagram with automatic syntax validation and error reporting for auto-fix workflows. Returns embeddable image URLs for valid diagrams or structured error details for invalid syntax that can be automatically corrected. Optionally saves the diagram to a local file."
version: "1.0.0"
price: "$0.01/call"
provider: "PlantUML"
---

# Generate Plantuml Diagram

Generate a PlantUML diagram with automatic syntax validation and error reporting for auto-fix workflows. Returns embeddable image URLs for valid diagrams or structured error details for invalid syntax that can be automatically corrected. Optionally saves the diagram to a local file.

**Provider:** PlantUML
**Price:** $0.01/call
**Pricing model:** Flat rate per call

## When to Use

Use this tool when you need to generate a plantuml diagram with automatic syntax validation and error reporting for auto-fix workflows. returns embeddable image urls for valid diagrams or structured error details for invalid syntax that can be automatically corrected. optionally saves the diagram to a local file.. This is part of the PlantUML provider on xpay✦.

## MCP Connection

Connect to xpay✦ to access this tool (and 2+ others):

```json
{
  "mcpServers": {
    "xpay": {
      "url": "https://mcp.xpay.sh/mcp?key=YOUR_API_KEY"
    }
  }
}
```

For Claude Code:
```bash
claude mcp add --transport http xpay "https://mcp.xpay.sh/mcp?key=YOUR_API_KEY"
```

## How to Execute

Use the xpay✦ meta-tools to run this tool:

1. **`xpay_details`** — Get full input schema: `xpay_details("plantuml/generate_plantuml_diagram")`
2. **`xpay_run`** — Execute: `xpay_run("plantuml/generate_plantuml_diagram", { ...inputs })`

## Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `format` | string | No | Output image format (SVG or PNG) |
| `plantuml_code` | string | Yes | PlantUML diagram code. Will be automatically validated for syntax errors before generating the diagram URL. |
| `output_path` | string | No | Optional. Path to save diagram locally. Automatically creates all necessary parent directories. Restricted to current working directory by default. Set PLANTUML_ALLOWED_DIRS env var (colon-separated paths, or "*" for unrestricted) to allow additional directories. Only .svg and .png extensions permitted. |

## Pricing

- **Cost:** $0.01/call
- **Balance check:** Use `xpay_balance` to check remaining credits
- Get your API key at [xpay.tools](https://xpay.tools/account/settings/api-keys/) — $5 free credits included

## Related Skills

- [PlantUML (all tools)](https://xpay.tools/skills/plantuml/SKILL.md) — 3 tools
- [Encode Plantuml](https://xpay.tools/skills/plantuml/encode-plantuml/SKILL.md) — $0.01/call
- [Decode Plantuml](https://xpay.tools/skills/plantuml/decode-plantuml/SKILL.md) — $0.01/call

## Links

- Tool page: https://xpay.tools/plantuml/generate-plantuml-diagram/
- Provider: https://xpay.tools/plantuml/
- All tools: https://xpay.tools/explore
