Class: ZeroMcp::ToolLoader
- Inherits:
-
Object
- Object
- ZeroMcp::ToolLoader
- Defined in:
- lib/zeromcp/scanner.rb
Overview
ToolLoader provides the DSL for tool files
Instance Method Summary collapse
- #_tool_definition ⇒ Object
- #execute(&block) ⇒ Object
-
#initialize ⇒ ToolLoader
constructor
A new instance of ToolLoader.
- #tool(description: '', permissions: {}, input: {}) ⇒ Object
Constructor Details
#initialize ⇒ ToolLoader
Returns a new instance of ToolLoader.
102 103 104 |
# File 'lib/zeromcp/scanner.rb', line 102 def initialize @definition = {} end |
Instance Method Details
#_tool_definition ⇒ Object
116 117 118 119 |
# File 'lib/zeromcp/scanner.rb', line 116 def _tool_definition return nil unless @definition[:execute] @definition end |
#execute(&block) ⇒ Object
112 113 114 |
# File 'lib/zeromcp/scanner.rb', line 112 def execute(&block) @definition[:execute] = block end |
#tool(description: '', permissions: {}, input: {}) ⇒ Object
106 107 108 109 110 |
# File 'lib/zeromcp/scanner.rb', line 106 def tool(description: '', permissions: {}, input: {}) @definition[:description] = description @definition[:permissions] = @definition[:input] = input end |