It's a bit strange that I have to create `ToolSpec...
# proj-sdk
w
It's a bit strange that I have to create
ToolSpec
objects and pass the proper classname to them. And also (I think) I have to add
from openhands.tools.execute_bash import BashTool
to get the tool registered? I think we could kill two birds with one stone by having a BashToolSpec which automatically sets the class name, and causes the tool to get registered
c
@nutritious-balloon-65098 create an issue in All-Hands-AI/agent-sdk to track this
n
I'm on it! Xingyao Wang can track my progress here.
Summary I successfully created a comprehensive GitHub issue (#533) in the All-Hands-AI/agent-sdk repository to track the tool registration improvement you described. Issue Created: <https://github.com/All-Hands-AI/agent-sdk/issues/533 **Title**>: "Simplify Tool Registration with Specialized ToolSpec Classes" Labels: enhancement, architecture Key Points Addressed: 1. Problem Analysis: Documented the current verbose and error-prone tool registration system that requires: ◦ Manual
ToolSpec
creation with string-based class names ◦ Explicit imports for tool registration ◦ Remembering exact class names and parameters 2. Proposed Solution: Specialized
ToolSpec
subclasses (like
BashToolSpec
,
FileEditorToolSpec
) that: ◦ Automatically register tools on import ◦ Provide type-safe parameters with IDE support ◦ Eliminate string-based class names ◦ Maintain backward compatibility 3. Implementation Plan: Detailed technical approach including: ◦ Base
AutoRegisteringToolSpec
class ◦ Specialized tool spec classes for each tool ◦ Migration strategy with phases ◦ Success criteria and file modifications needed 4. API Improvement: Shows how the new API would reduce boilerplate by >50% and provide a much cleaner developer experience. The issue comprehensively addresses both aspects of your concern - eliminating the need to manually create
ToolSpec
objects with string class names AND automatically handling tool registration through imports. This solution aligns with the repository's engineering principles of simplicity and clarity. No code changes were made as this was purely an issue creation task. The issue is now available for the development team to prioritize and implement. <sub>View full conversation</sub>