Class: VSM::Meta::Tools::ListTools

Inherits:
Base show all
Defined in:
lib/vsm/meta/tools.rb

Instance Attribute Summary

Attributes inherited from Base

#draft_store, #root, #snapshot_cache

Attributes inherited from ToolCapsule

#governance

Instance Method Summary collapse

Methods inherited from Base

#execution_mode, #initialize

Methods included from ActsAsTool

included, #tool_descriptor

Constructor Details

This class inherits a constructor from VSM::Meta::Tools::Base

Instance Method Details

#run(_args) ⇒ Object



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/vsm/meta/tools.rb', line 159

def run(_args)
  tools = flatten_tools(snapshot, []).select { _1[:kind] == "tool" }
  {
    tools: tools.map do |entry|
      descriptor = entry[:tool] || {}
      {
        tool_name: descriptor[:name] || entry[:name],
        capsule_path: entry[:path],
        description: descriptor[:description],
        schema: descriptor[:schema],
        class: entry[:class]
      }
    end
  }
end