Close the diagram editor session. Returns the final Mermaid code (last submitted version, or original if never submitted). Shuts down the local HTTP server.
AI agents use close_diagram to create or update resources in Software Design Mermaid — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Software Design Mermaid environment.
This tool performs a graceful session termination that may persist state (returns final code) and stops a service. While it does not create or delete user data irreversibly, it does modify the application state by closing an editor session and shutting down a server. This is reversible (the session can be reopened, the code is returned for preservation), making it Write rather than Destructive.
From the tool's definition The tool closes an editing session and returns final Mermaid code, which involves persisting or returning a modified state. It shuts down a local HTTP server, modifying the system's running processes.
Documented attack patterns abuse exactly the kind of access close_diagram gives an agent:
PolicyLayer is an MCP gateway — it sits between your AI agents and Software Design Mermaid, and nothing reaches the server without passing your rules. This is the rule we recommend for close_diagram:
{
"version": "1",
"default": "deny",
"tools": {
"close_diagram": {
"limits": [
{
"counter": "close_diagram_rate",
"window": "minute",
"max": 30,
"scope": "grant"
}
]
}
}
} close_diagram stays usable, but capped — an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
Free to start. No card required.
Close the diagram editor session. Returns the final Mermaid code (last submitted version, or original if never submitted). Shuts down the local HTTP server. It is categorised as a Write tool in the Software Design Mermaid MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
Register the Software Design Mermaid MCP server in PolicyLayer and add a rule for close_diagram: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Software Design Mermaid. Nothing to install.
close_diagram is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the close_diagram rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for close_diagram. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
close_diagram is provided by the Software Design Mermaid MCP server (wzh4464/software-design-mermaid-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Start from Software Design Mermaid, add the rest of your stack, and see everything your agents can call. Then put policy on all of it.
Free to start. No card required.
3 Software Design Mermaid tools catalogued and risk-classified — across an index of 43,000+ MCP servers.