"""MCP tool implementations for FreeCAD.

This package contains all MCP tool definitions for interacting with FreeCAD.
Tools are organized by category:

- execution: Python code execution tools
- documents: Document management tools
- objects: Object creation and manipulation tools
- partdesign: PartDesign workbench tools
- export: Export functionality tools
- macros: Macro management tools
- view: View and screenshot tools
"""

from collections.abc import Awaitable, Callable
from typing import Any

from freecad_mcp.tools.documents import register_document_tools
from freecad_mcp.tools.execution import register_execution_tools
from freecad_mcp.tools.export import register_export_tools
from freecad_mcp.tools.macros import register_macro_tools
from freecad_mcp.tools.objects import register_object_tools
from freecad_mcp.tools.partdesign import register_partdesign_tools
from freecad_mcp.tools.view import register_view_tools

__all__ = [
    "register_all_tools",
    "register_document_tools",
    "register_execution_tools",
    "register_export_tools",
    "register_macro_tools",
    "register_object_tools",
    "register_partdesign_tools",
    "register_view_tools",
]


def register_all_tools(mcp: Any, get_bridge_func: Callable[[], Awaitable[Any]]) -> None:
    """Register all FreeCAD tools with the Robust MCP Server.

    Args:
        mcp: The FastMCP (Robust MCP Server) instance (Any due to lack of stubs).
        get_bridge_func: Async function returning the active bridge connection.
    """
    register_execution_tools(mcp, get_bridge_func)
    register_document_tools(mcp, get_bridge_func)
    register_object_tools(mcp, get_bridge_func)
    register_partdesign_tools(mcp, get_bridge_func)
    register_export_tools(mcp, get_bridge_func)
    register_macro_tools(mcp, get_bridge_func)
    register_view_tools(mcp, get_bridge_func)
