get_mindmap
Retrieve and serialize mind map structures from MindManager with customizable detail levels for efficient data extraction and integration.
Instructions
Retrieves the current mind map structure from MindManager.
Args:
mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'.
turbo_mode (bool): Enable turbo mode (text only). Defaults to False.
Returns:
Dict[str, Any]: Serialized mind map structure or error dictionary.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | full | |
| turbo_mode | No |
Implementation Reference
- mindm_mcp/server.py:171-193 (handler)The primary handler function for the 'get_mindmap' MCP tool. Registered via @mcp.tool() decorator. Implements the tool logic by calling helper _get_mindmap_content, serializing the result, and handling errors.@mcp.tool() async def get_mindmap( mode: str = 'full', turbo_mode: bool = False ) -> Dict[str, Any]: """ Retrieves the current mind map structure from MindManager. Args: mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'. turbo_mode (bool): Enable turbo mode (text only). Defaults to False. Returns: Dict[str, Any]: Serialized mind map structure or error dictionary. """ try: print(f"Calling get_mindmap(mode={mode}, turbo_mode={turbo_mode})", file=sys.stderr) mindmap = _get_mindmap_content(mode=mode, turbo_mode=turbo_mode) print("get_mindmap successful, returning serialized mindmap.", file=sys.stderr) return _serialize_result(mindmap) except Exception as e: return _handle_mindmanager_error("get_mindmap", e)
- mindm_mcp/server.py:117-122 (helper)Core helper function that creates a MindmapDocument instance and retrieves the mindmap structure if available.def _get_mindmap_content(mode='content', turbo_mode=False): document = _get_document_instance(turbo_mode=turbo_mode) if document.get_mindmap(mode=mode): return document.mindmap return None
- mindm_mcp/server.py:171-171 (registration)The @mcp.tool() decorator registers the get_mindmap function as an MCP tool.@mcp.tool()
- mindm_mcp/server.py:172-185 (schema)Function signature and docstring define the input schema (parameters: mode:str, turbo_mode:bool) and output schema (Dict[str, Any]).async def get_mindmap( mode: str = 'full', turbo_mode: bool = False ) -> Dict[str, Any]: """ Retrieves the current mind map structure from MindManager. Args: mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'. turbo_mode (bool): Enable turbo mode (text only). Defaults to False. Returns: Dict[str, Any]: Serialized mind map structure or error dictionary. """