Class: SwarmSDK::Tools::Base
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- SwarmSDK::Tools::Base
- Defined in:
- lib/swarm_sdk/tools/base.rb
Overview
Base class for all SwarmSDK tools
Provides:
- Declarative removability control
- Common tool functionality
- Standard initialization patterns
Removability
Tools can be marked as non-removable to ensure they're always available:
class Think < Base
removable false
end
Non-removable tools are included even when skills specify a limited toolset.
Direct Known Subclasses
Bash, Clock, Delegate, Edit, Glob, Grep, McpToolStub, MultiEdit, Read, Scratchpad::ScratchpadList, Scratchpad::ScratchpadRead, Scratchpad::ScratchpadWrite, Think, TodoWrite, WebFetch, Write
Class Method Summary collapse
-
.removable(value) ⇒ void
Mark tool as removable or non-removable.
-
.removable? ⇒ Boolean
Whether this tool can be deactivated by LoadSkill.
Instance Method Summary collapse
-
#removable? ⇒ Boolean
Instance method for checking removability.
Class Method Details
.removable(value) ⇒ void
This method returns an undefined value.
Mark tool as removable or non-removable
50 51 52 |
# File 'lib/swarm_sdk/tools/base.rb', line 50 def removable(value) @removable = value end |
.removable? ⇒ Boolean
Whether this tool can be deactivated by LoadSkill
Non-removable tools are ALWAYS active regardless of skill toolset. Use for essential tools that agents should never lose.
39 40 41 |
# File 'lib/swarm_sdk/tools/base.rb', line 39 def removable? @removable.nil? ? true : @removable end |
Instance Method Details
#removable? ⇒ Boolean
Instance method for checking removability
58 59 60 |
# File 'lib/swarm_sdk/tools/base.rb', line 58 def removable? self.class.removable? end |