get_grounding_information
Extract central topics and selected subtopics from mind maps to provide structural context for analysis or processing.
Instructions
Extracts grounding information (central topic, selected subtopics) from the mindmap.
Args:
mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'.
turbo_mode (bool): Enable turbo mode (text only). Defaults to False.
Returns:
Union[List[str], Dict[str, str]]: A list containing [top_most_topic, subtopics_string] or error dictionary.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | full | |
| turbo_mode | No |
Implementation Reference
- mindm_mcp/server.py:253-277 (handler)The primary handler for the 'get_grounding_information' MCP tool. Registered via @mcp.tool() decorator. Handles parameters, calls helper function, serializes output, and manages errors.@mcp.tool() async def get_grounding_information( mode: str = 'full', turbo_mode: bool = False ) -> Union[List[str], Dict[str, str]]: """ Extracts grounding information (central topic, selected subtopics) from the mindmap. Args: mode (str): Detail level ('full', 'content', 'text'). Defaults to 'full'. turbo_mode (bool): Enable turbo mode (text only). Defaults to False. Returns: Union[List[str], Dict[str, str]]: A list containing [top_most_topic, subtopics_string] or error dictionary. """ try: print("Calling get_grounding_information()", file=sys.stderr) top_most, subtopics_str = _get_grounding_information(mode=mode, turbo_mode=turbo_mode) print(f"get_grounding_information() returned: top='{top_most}', subtopics='{subtopics_str}'", file=sys.stderr) return [top_most, subtopics_str] # Return as list for JSON except Exception as e: # This function doesn't directly call MindManager, so errors are less likely external print(f"ERROR in get_grounding_information: {e}", file=sys.stderr) return {"error": "Internal Error", "message": f"Failed to get grounding information: {e}"}
- mindm_mcp/server.py:110-115 (helper)Supporting helper function that creates a MindmapDocument instance, retrieves the mindmap and selection, and calls the underlying get_grounding_information method on the document.def _get_grounding_information(mode='text', turbo_mode=True): document = _get_document_instance(turbo_mode=turbo_mode) if document.get_mindmap(mode=mode): document.get_selection() return document.get_grounding_information() return None
- mindm_mcp/server.py:253-253 (registration)The @mcp.tool() decorator registers the get_grounding_information function as an MCP tool.@mcp.tool()