feat(manage_tools): add runtime tool management capabilities#390
Open
cagataycali wants to merge 2 commits intostrands-agents:mainfrom
Open
feat(manage_tools): add runtime tool management capabilities#390cagataycali wants to merge 2 commits intostrands-agents:mainfrom
cagataycali wants to merge 2 commits intostrands-agents:mainfrom
Conversation
Add manage_tools tool for dynamic tool management at runtime without restarts. Features: - list: Display all currently registered tools - add: Load tools from packages, files, URLs, or GitHub - remove: Unregister tools by name - reload: Hot-reload tools to pick up code changes - create: Generate new tools from Python code on-the-fly - fetch: Download and load tools from remote URLs - discover: List all available tools in a module with introspection - sandbox: Validate code in isolated subprocess before loading Key highlights: - Package manager for AI agent tools - Auto-installation of missing PyPI packages via pip or uv - Sandbox testing validates code before loading into agent - GitHub blob URL auto-conversion to raw URLs - Configurable via environment variables: - STRANDS_AUTO_INSTALL_TOOLS: Enable automatic package installation - STRANDS_PACKAGE_INSTALLER: Choose pip or uv - STRANDS_INSTALL_TIMEOUT: Package installation timeout - STRANDS_DISABLE_LOAD_TOOL: Disable dynamic tool loading - STRANDS_TOOLS_CACHE_DIR: Cache directory for fetched tools - Comprehensive test coverage
Use repr() to properly escape file paths on Windows, preventing unicode escape sequence errors when paths contain backslashes like C:\Users\... where \U is interpreted as \UXXXXXXXX.
| return cache_dir | ||
|
|
||
|
|
||
| def _fetch_from_url(url: str) -> str: |
Contributor
There was a problem hiding this comment.
we had some secruity issues related to url, we need to restrict urls, do validations.
Contributor
Author
There was a problem hiding this comment.
network limitations should be applied on runtime level, not on tool to be secure. for example, shell tool have unrestricted access to shell but OS layer determine that operation is successful or not, same applies for this tool
Contributor
|
/strands review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
manage_toolstool for dynamic tool management at runtime - a package manager for AI agent tools.Features
Key Highlights
Environment Variables
STRANDS_AUTO_INSTALL_TOOLSfalseSTRANDS_PACKAGE_INSTALLERpiporuv)pipSTRANDS_INSTALL_TIMEOUT300STRANDS_DISABLE_LOAD_TOOLfalseSTRANDS_TOOLS_CACHE_DIRUsage Examples
Testing
Checklist