serialize_current_mindmap_to_markdown
Convert the currently loaded mind map to Markdown format for easy sharing and documentation. Includes options for notes, detail levels, and text-only turbo mode for efficient conversion.
Instructions
Serializes the currently loaded mindmap to Markdown format.
Args:
include_notes (bool): If True, include notes in the serialization. Defaults to True.
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]]: Markdown formatted string or error dictionary.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_notes | No | ||
| mode | No | content | |
| turbo_mode | No |
Implementation Reference
- mindm_mcp/server.py:308-332 (handler)The main async handler function for the MCP tool 'serialize_current_mindmap_to_markdown', including registration via @mcp.tool(), input schema via type hints and docstring, and core logic delegating to _serialize_markdown helper.@mcp.tool() async def serialize_current_mindmap_to_markdown( include_notes: bool = True, mode: str = 'content', turbo_mode: bool = False ) -> Union[str, Dict[str, str]]: """ Serializes the currently loaded mindmap to Markdown format. Args: include_notes (bool): If True, include notes in the serialization. Defaults to True. mode (str): Detail level ('full', 'content', 'text'). Defaults to 'content'. turbo_mode (bool): Enable turbo mode (text only). Defaults to False. Returns: Union[str, Dict[str, str]]: Markdown formatted string or error dictionary. """ try: print(f"Serializing current mindmap to Markdown.", file=sys.stderr) text = _serialize_markdown(include_notes=include_notes, mode=mode, turbo_mode=turbo_mode) print("Serialization to Markdown successful.", file=sys.stderr) return text except Exception as e: print(f"ERROR during serialization to Markdown: {e}", file=sys.stderr) return {"error": "Serialization Error", "message": f"Failed to serialize to Markdown: {e}"}
- mindm_mcp/server.py:147-152 (helper)Internal helper function that instantiates MindmapDocument, loads the current mindmap, and invokes the external serialization.serialize_mindmap_markdown for the actual markdown generation.def _serialize_markdown(include_notes=True, mode='content', turbo_mode=False): document = _get_document_instance(turbo_mode=turbo_mode) if document.get_mindmap(mode=mode): markdown = serialization.serialize_mindmap_markdown(document.mindmap, include_notes=include_notes) return markdown return None