| 7 | |
| 8 | |
| 9 | def build_default_registry( |
| 10 | *, |
| 11 | include_user_tools: bool = True, |
| 12 | provider: "Any | None" = None, |
| 13 | get_available_mcp_servers: Callable[[], list[str]] | None = None, |
| 14 | ) -> ToolRegistry: |
| 15 | registry = ToolRegistry() |
| 16 | for tool in ALL_STATIC_TOOLS: |
| 17 | registry.register(tool) |
| 18 | registry.register( |
| 19 | make_agent_tool( |
| 20 | registry, |
| 21 | provider=provider, |
| 22 | get_available_mcp_servers=get_available_mcp_servers, |
| 23 | ) |
| 24 | ) |
| 25 | registry.register(make_tool_search_tool(registry)) |
| 26 | |
| 27 | # Dynamic workflows. Registered unconditionally (like the Agent tool, which |
| 28 | # also needs the registry + provider); the tool's ``is_enabled`` is the |
| 29 | # single runtime gate (``get_tools`` filters by it fresh), so a ``/config`` |
| 30 | # toggle of ``disable_workflows`` takes effect without rebuilding the registry. |
| 31 | from .tools.workflow import make_workflow_tool |
| 32 | |
| 33 | registry.register(make_workflow_tool(registry, provider=provider)) |
| 34 | |
| 35 | return registry |