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: {}, route: nil) ⇒ Object
Constructor Details
#initialize ⇒ ToolLoader
Returns a new instance of ToolLoader.
103 104 105 |
# File 'lib/zeromcp/scanner.rb', line 103 def initialize @definition = {} end |
Instance Method Details
#_tool_definition ⇒ Object
118 119 120 121 |
# File 'lib/zeromcp/scanner.rb', line 118 def _tool_definition return nil unless @definition[:execute] @definition end |
#execute(&block) ⇒ Object
114 115 116 |
# File 'lib/zeromcp/scanner.rb', line 114 def execute(&block) @definition[:execute] = block end |
#tool(description: '', permissions: {}, input: {}, route: nil) ⇒ Object
107 108 109 110 111 112 |
# File 'lib/zeromcp/scanner.rb', line 107 def tool(description: '', permissions: {}, input: {}, route: nil) @definition[:description] = description @definition[:permissions] = @definition[:input] = input @definition[:route] = route end |