Problem Statement
I would like to move the ToolProvider class out of experimental, and update references of it to remove mentions of experimental
Proposed Solution
No response
Use Case
You can import ToolProvider from outside of the experimental namespace
Alternatives Solutions
No response
Additional Context
No response
Implementation Requirements
Based on clarification discussion and repository analysis:
Overview
Move ToolProvider abstract base class from strands.experimental.tools to strands.tools as a stable public API, with backward compatibility via deprecation warning.
Technical Approach
1. Move ToolProvider Class
- Source:
src/strands/experimental/tools/tool_provider.py
- Target:
src/strands/tools/tool_provider.py
- Target Import:
from strands.tools import ToolProvider
2. Update Exports
- Add
ToolProvider to src/strands/tools/__init__.py:
from .tool_provider import ToolProvider
__all__ = [
# ... existing exports ...
"ToolProvider",
]
3. Backward Compatibility with Deprecation Warning
Update src/strands/experimental/tools/__init__.py following the pattern from hooks/events.py:
"""Experimental tools package."""
import warnings
from typing import Any
from ...tools import ToolProvider
_DEPRECATED_ALIASES = {
"ToolProvider": ToolProvider,
}
def __getattr__(name: str) -> Any:
if name in _DEPRECATED_ALIASES:
warnings.warn(
f"{name} has been moved to production. "
f"Use {_DEPRECATED_ALIASES[name].__name__} from strands.tools instead.",
DeprecationWarning,
stacklevel=2,
)
return _DEPRECATED_ALIASES[name]
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
__all__: list[str] = []
4. Update Internal Imports (6 files)
Source files:
| File |
Current Import |
New Import |
src/strands/agent/agent.py |
from ..experimental.tools import ToolProvider |
from ..tools import ToolProvider |
src/strands/tools/mcp/mcp_client.py |
from ...experimental.tools import ToolProvider |
from .. import ToolProvider |
src/strands/tools/registry.py |
from ..experimental.tools import ToolProvider |
from . import ToolProvider |
src/strands/experimental/bidi/agent/agent.py |
from ...tools import ToolProvider |
from ....tools import ToolProvider |
Test files:
| File |
Current Import |
New Import |
tests/strands/tools/test_registry.py |
from strands.experimental.tools import ToolProvider |
from strands.tools import ToolProvider |
tests/strands/tools/test_registry_tool_provider.py |
from strands.experimental.tools.tool_provider import ToolProvider |
from strands.tools import ToolProvider |
5. Update MCPClient Docstring
Remove experimental warning from src/strands/tools/mcp/mcp_client.py:
Remove this warning block from docstring (lines ~110-112):
Warning:
This class implements the experimental ToolProvider interface and its methods
are subject to change.
6. Update Documentation
Update AGENTS.md directory structure to reflect new location:
- Remove:
│ │ └── tools/ # Experimental tools
- Remove:
│ │ └── tool_provider.py
- Add
tool_provider.py under src/strands/tools/ section
Acceptance Criteria
Problem Statement
I would like to move the ToolProvider class out of experimental, and update references of it to remove mentions of experimental
Proposed Solution
No response
Use Case
You can import ToolProvider from outside of the experimental namespace
Alternatives Solutions
No response
Additional Context
No response
Implementation Requirements
Based on clarification discussion and repository analysis:
Overview
Move
ToolProviderabstract base class fromstrands.experimental.toolstostrands.toolsas a stable public API, with backward compatibility via deprecation warning.Technical Approach
1. Move ToolProvider Class
src/strands/experimental/tools/tool_provider.pysrc/strands/tools/tool_provider.pyfrom strands.tools import ToolProvider2. Update Exports
ToolProvidertosrc/strands/tools/__init__.py:3. Backward Compatibility with Deprecation Warning
Update
src/strands/experimental/tools/__init__.pyfollowing the pattern fromhooks/events.py:4. Update Internal Imports (6 files)
Source files:
src/strands/agent/agent.pyfrom ..experimental.tools import ToolProviderfrom ..tools import ToolProvidersrc/strands/tools/mcp/mcp_client.pyfrom ...experimental.tools import ToolProviderfrom .. import ToolProvidersrc/strands/tools/registry.pyfrom ..experimental.tools import ToolProviderfrom . import ToolProvidersrc/strands/experimental/bidi/agent/agent.pyfrom ...tools import ToolProviderfrom ....tools import ToolProviderTest files:
tests/strands/tools/test_registry.pyfrom strands.experimental.tools import ToolProviderfrom strands.tools import ToolProvidertests/strands/tools/test_registry_tool_provider.pyfrom strands.experimental.tools.tool_provider import ToolProviderfrom strands.tools import ToolProvider5. Update MCPClient Docstring
Remove experimental warning from
src/strands/tools/mcp/mcp_client.py:Remove this warning block from docstring (lines ~110-112):
6. Update Documentation
Update
AGENTS.mddirectory structure to reflect new location:│ │ └── tools/ # Experimental tools│ │ └── tool_provider.pytool_provider.pyundersrc/strands/tools/sectionAcceptance Criteria
ToolProvidercan be imported fromstrands.toolsstrands.experimental.tools.ToolProviderstill works but emitsDeprecationWarninghatch fmt --formatterandhatch fmt --linterpasshatch testpasses