Skip to main content
Glama
robertZaufall

MindManager MCP Server

create_mindmap_from_mermaid

Convert Mermaid mindmap text into a MindManager mindmap, enabling structured visualization from code-based descriptions with metadata support.

Instructions

Deserializes a Mermaid mindmap and creates a MindManager mindmap from it (caller must follow the guidance).

Args:
    mermaid (str): Mermaid text describing the desired mindmap with supported topic metadata, e.g. `[Topic] %% {"id": n, "notes": {"text": "Notes"}, "links": [{"text": "label", "url": "https://example.com"}], "references": [{"id_1": i, "id_2": j, "direction": 1}], "image": {"text": "C:\path\to\image.png"}, "icons": [{"text": "StockIcon-36", "is_stock_icon": true, "index": 36}], "tags": ["tag1"]}`

Guidance for callers constructing `mermaid`:
- Every line must be syntactically correct Mermaid code and contain at least a topic label, e.g. `[Topic]`.
- For the root topic just use the label, e.g. `[Central Topic]`
- Full syntax supports attaching metadata via JSON after `%%` on the same line, e.g.
  `[Topic] %% {"id": n, "notes": {"text": "Notes"}, "links": [{"text": "label", "url": "https://example.com"}], "references": [{"id_1": i, "id_2": j, "direction": 1}], "image": {"text": "C:\path\to\image.png"}, "icons": [{"text": "StockIcon-36", "is_stock_icon": true, "index": m}], "tags": ["tag1"]}`
- For icons, use `icons`: `[{"text": "StockIcon-<index>", "is_stock_icon": true, "index": <index>}]` where available options for stock icons are: Arrow Down(66), Arrow Left(65), Arrow Right(37), Arrow Up(36), Bomb(51), Book(67), Broken Connection(69), Calendar(8), Camera(41), Cellphone(40), Check(62), Clock(7), Coffee Cup(59), Dollar(15), Email(10), Emergency(49), Euro(16), Exclamation Mark(44), Fax(42), Flag Black(20), Flag Blue(18), Flag Green(19), Flag Orange(21), Flag Purple(23), Flag Red(17), Flag Yellow(22), Folder(71), Glasses(53), Hourglass(48), House(13), Information(70), Judge Hammer(54), Key(52), Letter(9), Lightbulb(58), Magnifying Glass(68), Mailbox(11), Marker 1(25), Marker 2(26), Marker 3(27), Marker 4(28), Marker 5(29), Marker 6(30), Marker 7(31), Meeting(61), Megaphone(12), No Entry(50), Note(63), On Hold(47), Padlock Locked(34), Padlock Unlocked(35), Phone(39), Question Mark(45), Redo(57), Resource 1(32), Resource 2(33), Rocket(55), Rolodex(14), Scales(56), Smiley Angry(5), Smiley Happy(2), Smiley Neutral(3), Smiley Sad(4), Smiley Screaming(6), Stop(43), Thumbs Down(64), Thumbs Up(46), Traffic Lights Red(24), Two End Arrow(38), Two Feet(60).

Returns:
    Dict[str, str]: Status dictionary indicating success or error details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mermaidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function decorated with @mcp.tool() that implements the core logic: input validation, deserialization via _deserialize_mermaid, mindmap creation in MindManager, and error handling. The function signature and docstring define the tool schema.
    @mcp.tool()
    async def create_mindmap_from_mermaid(
        mermaid: str
    ) -> Dict[str, str]:
        """
        Deserializes a Mermaid mindmap and creates a MindManager mindmap from it (caller must follow the guidance).
    
        Args:
            mermaid (str): Mermaid text describing the desired mindmap with supported topic metadata, e.g. `[Topic] %% {"id": n, "notes": {"text": "Notes"}, "links": [{"text": "label", "url": "https://example.com"}], "references": [{"id_1": i, "id_2": j, "direction": 1}], "image": {"text": "C:\\path\\to\\image.png"}, "icons": [{"text": "StockIcon-36", "is_stock_icon": true, "index": 36}], "tags": ["tag1"]}`
        
        Guidance for callers constructing `mermaid`:
        - Every line must be syntactically correct Mermaid code and contain at least a topic label, e.g. `[Topic]`.
        - For the root topic just use the label, e.g. `[Central Topic]`
        - Full syntax supports attaching metadata via JSON after `%%` on the same line, e.g.
          `[Topic] %% {"id": n, "notes": {"text": "Notes"}, "links": [{"text": "label", "url": "https://example.com"}], "references": [{"id_1": i, "id_2": j, "direction": 1}], "image": {"text": "C:\\path\\to\\image.png"}, "icons": [{"text": "StockIcon-36", "is_stock_icon": true, "index": m}], "tags": ["tag1"]}`
        - For icons, use `icons`: `[{"text": "StockIcon-<index>", "is_stock_icon": true, "index": <index>}]` where available options for stock icons are: Arrow Down(66), Arrow Left(65), Arrow Right(37), Arrow Up(36), Bomb(51), Book(67), Broken Connection(69), Calendar(8), Camera(41), Cellphone(40), Check(62), Clock(7), Coffee Cup(59), Dollar(15), Email(10), Emergency(49), Euro(16), Exclamation Mark(44), Fax(42), Flag Black(20), Flag Blue(18), Flag Green(19), Flag Orange(21), Flag Purple(23), Flag Red(17), Flag Yellow(22), Folder(71), Glasses(53), Hourglass(48), House(13), Information(70), Judge Hammer(54), Key(52), Letter(9), Lightbulb(58), Magnifying Glass(68), Mailbox(11), Marker 1(25), Marker 2(26), Marker 3(27), Marker 4(28), Marker 5(29), Marker 6(30), Marker 7(31), Meeting(61), Megaphone(12), No Entry(50), Note(63), On Hold(47), Padlock Locked(34), Padlock Unlocked(35), Phone(39), Question Mark(45), Redo(57), Resource 1(32), Resource 2(33), Rocket(55), Rolodex(14), Scales(56), Smiley Angry(5), Smiley Happy(2), Smiley Neutral(3), Smiley Sad(4), Smiley Screaming(6), Stop(43), Thumbs Down(64), Thumbs Up(46), Traffic Lights Red(24), Two End Arrow(38), Two Feet(60).
    
        Returns:
            Dict[str, str]: Status dictionary indicating success or error details.
        """
        if not mermaid or not mermaid.strip():
            return {"error": "Invalid Input", "message": "Mermaid content is required."}
    
        try:
            print("Creating mindmap from Mermaid diagram (full).", file=sys.stderr)
            _deserialize_mermaid(mermaid=mermaid, turbo_mode=False)
            print("Mindmap created from Mermaid diagram.", file=sys.stderr)
            ret_val = {"status": "success", "message": "Mindmap created from Mermaid diagram."}
            return ret_val
        except Exception as e:
            return _handle_mindmanager_error("create_mindmap_from_mermaid", e)
  • Key helper function that performs the Mermaid deserialization using serialization.deserialize_mermaid_full, creates a MindmapDocument instance, sets the mindmap, and calls create_mindmap() to apply it to MindManager.
    def _deserialize_mermaid(mermaid="", turbo_mode=True):
        guid_mapping = {}
        deserialized = serialization.deserialize_mermaid_full(mermaid, guid_mapping)
        document = _get_document_instance(turbo_mode=turbo_mode)
        document.mindmap = deserialized
        document.create_mindmap()
        return None
  • Helper to create MindmapDocument instance used in deserialization and mindmap creation.
    def _get_document_instance(
            charttype: str = 'auto', 
            turbo_mode: bool = False, 
            inline_editing_mode: bool = False, 
            mermaid_mode: bool = True, 
            macos_access: str = MACOS_ACCESS_METHOD
        ) -> MindmapDocument:
        document = MindmapDocument(
            charttype=charttype, 
            turbo_mode=turbo_mode, 
            inline_editing_mode=inline_editing_mode, 
            mermaid_mode=mermaid_mode, 
            macos_access=macos_access
        )
        return document
  • Helper function to format and return standardized error responses for MindManager operations, used in the handler.
    def _handle_mindmanager_error(func_name: str, e: Exception) -> Dict[str, str]:
        """Formats MindManager errors for MCP response."""
        error_message = f"Error during MindManager operation '{func_name}': {e}"
        print(f"ERROR: {error_message}", file=sys.stderr)
        # Check for specific known errors from mindm.mindmanager if possible
        if "No document found" in str(e):
            return {"error": "MindManager Error", "message": "No document found or MindManager not running."}
        # Add more specific error checks here based on mindm library
        return {"error": "MindManager Error", "message": f"An error occurred: {e}"}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It implies a write operation ('creates') but doesn't disclose behavioral traits like required permissions, whether it overwrites existing mindmaps, error handling, or performance characteristics. The 'Guidance for callers' section focuses on input syntax rather than tool behavior, leaving significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately front-loaded with the core purpose, but the 'Guidance for callers' section is lengthy and could be more structured. While detailed, some information (like the full icon list) might be excessive for a description. It's comprehensive but not optimally concise, with room for better organization.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (single parameter but with intricate syntax), the description provides substantial context for the input. With an output schema present, it doesn't need to explain return values. However, for a mutation tool with no annotations, it lacks behavioral context about side effects, error conditions, and integration considerations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must fully compensate. It provides extensive semantic details for the single parameter 'mermaid', including syntax examples, metadata structure, and a comprehensive list of icon options. This goes far beyond what the bare schema offers, making the parameter fully understandable for implementation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'deserializes a Mermaid mindmap and creates a MindManager mindmap from it', which is a specific verb+resource combination. It distinguishes from the sibling 'create_mindmap_from_mermaid_simple' by implying this version handles more complex metadata, though not explicitly stated. The purpose is clear but could be more explicit about differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives like 'create_mindmap_from_mermaid_simple' or other serialization tools. It mentions 'caller must follow the guidance', but this refers to input construction, not tool selection. There is no context on prerequisites, error conditions, or comparative use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/robertZaufall/mindm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server