Medium Risk

close_diagram

Close the diagram editor session. Returns the final Mermaid code (last submitted version, or original if never submitted). Shuts down the local HTTP server.

How to control close_diagram ↓

What close_diagram does on Software Design Mermaid

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.

Medium Risk

Why close_diagram needs a policy

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:

How to control close_diagram

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:

policy.json
{
  "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.

  1. Create a free account and register Software Design Mermaid — nothing to install.
  2. Add this policy — paste it, or build it visually.
  3. Point your MCP client (Claude, Cursor, anything) at your gateway URL.
LIMIT THIS TOOL →

Free to start. No card required.

Related tools and policies

Go deeper

Questions about close_diagram

What does the close_diagram tool do? +

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.

How do I enforce a policy on close_diagram? +

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.

What risk level is close_diagram? +

close_diagram is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.

Can I rate-limit close_diagram? +

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.

How do I block close_diagram completely? +

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.

What MCP server provides close_diagram? +

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.

Enforce policy on every Software Design Mermaid tool call.

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.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.