clean_mermaid_diagram
Removes note statements, empty braces, and post-newline text from Mermaid class diagrams to prevent unreadable yellow boxes and produce clean diagram code.
Instructions
Clean a Mermaid class diagram by removing unwanted elements.
This tool removes:
- All note statements that would render as unreadable yellow boxes
- Empty curly braces from class definitions (handles both single-line and multi-line)
- Strings after newline characters (e.g., truncates "ClassName
extra" to "ClassName")
Args:
mermaid_content: The raw Mermaid class diagram content
Returns:
Cleaned Mermaid content with note statements, empty braces, and post-newline strings removed
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Session id returned by `create_session()`. This server serves many users from one process; the session id is what keeps your output directory and generated plots private to you. Pass the SAME value on every tool call. If the server replies that the session is unknown or expired, call `create_session()` again and use the new id. | |
| mermaid_content | Yes |