Skip to main content
Glama
robertZaufall

MindManager MCP Server

serialize_current_mindmap_to_mermaid

Convert the active mind map to Mermaid format for visualization, with options to control detail level and include only IDs or text content.

Instructions

Serializes the currently loaded mindmap to Mermaid format.

Args:
    id_only (bool): If True, only include IDs without detailed attributes. Defaults to False.
    mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'.
    turbo_mode (bool): Enable turbo mode (text only). Defaults to False.

Returns:
    Union[str, Dict[str, str]]: Mermaid formatted string or error dictionary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_onlyNo
modeNofull
turbo_modeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary handler for the 'serialize_current_mindmap_to_mermaid' MCP tool. Decorated with @mcp.tool() for automatic registration. Calls internal _serialize_mermaid helper, handles MindManager errors, and returns Mermaid diagram or error dict.
    @mcp.tool()
    async def serialize_current_mindmap_to_mermaid(
        id_only: bool = False,
        mode: str = 'full',
        turbo_mode: bool = False
    ) -> Union[str, Dict[str, str]]:
        """
        Serializes the currently loaded mindmap to Mermaid format.
    
        Args:
            id_only (bool): If True, only include IDs without detailed attributes. Defaults to False.
            mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'.
            turbo_mode (bool): Enable turbo mode (text only). Defaults to False.
    
        Returns:
            Union[str, Dict[str, str]]: Mermaid formatted string or error dictionary.
        """
        try:
            print(f"Serializing current mindmap to Mermaid (id_only={id_only}).", file=sys.stderr)
            text = _serialize_mermaid(id_only=id_only, mode=mode, turbo_mode=turbo_mode)
            print("Serialization to Mermaid successful.", file=sys.stderr)
            return text
        except Exception as e:
            print(f"ERROR during serialization to Mermaid: {e}", file=sys.stderr)
            return {"error": "Serialization Error", "message": f"Failed to serialize to Mermaid: {e}"}
  • Core helper function that retrieves the current mindmap from MindManager via MindmapDocument, builds GUID-to-ID mapping, and serializes the mindmap structure to Mermaid format using the external 'serialization' module.
    def _serialize_mermaid(id_only=True, mode='content', turbo_mode=False):
        document = _get_document_instance(turbo_mode=turbo_mode)
        if document.get_mindmap(mode=mode):
            guid_mapping = {}
            serialization.build_mapping(document.mindmap, guid_mapping)
            mermaid = serialization.serialize_mindmap(document.mindmap, guid_mapping, id_only=id_only)
            return mermaid
        return None
  • The @mcp.tool() decorator on the handler function registers 'serialize_current_mindmap_to_mermaid' as an MCP tool in the FastMCP server instance 'mcp'.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return type ('Mermaid formatted string or error dictionary'), which is helpful, but lacks other critical information: it doesn't specify whether this is a read-only operation (though implied by 'serializes'), what happens if no mindmap is loaded, potential side effects, or performance characteristics. The description adds some value but leaves significant gaps for a tool with mutation implications.

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, Args, Returns) and front-loaded the core functionality. Each sentence earns its place: the first states the purpose, and the subsequent sections efficiently document parameters and returns. It could be slightly more concise by integrating parameter defaults more seamlessly, but overall it's appropriately sized without wasted words.

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 tool's moderate complexity (3 parameters, no annotations, but has output schema), the description is reasonably complete. It covers the purpose, parameters, and return values. The output schema existence means the description doesn't need to detail return structures, which it acknowledges. However, it lacks context about the 'currently loaded mindmap' state dependency and doesn't reference sibling tools, leaving some gaps in full contextual understanding.

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

Parameters4/5

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

The description provides detailed parameter information in the 'Args' section, explaining the purpose of each parameter: 'id_only' controls ID inclusion, 'mode' sets detail level with specific options, and 'turbo_mode' enables text-only output. With 0% schema description coverage (schema only has titles like 'Id Only'), this compensates well by adding meaningful semantics beyond the bare schema. However, it doesn't fully explain interactions between parameters (e.g., how 'turbo_mode' relates to 'mode').

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's purpose: 'Serializes the currently loaded mindmap to Mermaid format.' This is a specific verb ('serializes') and resource ('currently loaded mindmap') with a clear output format ('Mermaid format'). It distinguishes from siblings like 'serialize_current_mindmap_to_json' and 'serialize_current_mindmap_to_markdown' by specifying the target format. However, it doesn't explicitly contrast with these siblings in the description text.

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 guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'serialize_current_mindmap_to_json' or 'serialize_current_mindmap_to_markdown' to help the agent choose between different serialization formats. There's also no context about prerequisites (e.g., whether a mindmap must be loaded first) or typical 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