Skip to content

Commit b21fac8

Browse files
committed
Start converting over
1 parent f081d24 commit b21fac8

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

lib/ruby_llm/docker/list_containers.rb

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,8 @@ module Docker
2727
class ListContainers < RubyLLM::Tool
2828
description 'List Docker containers'
2929

30-
input_schema(
31-
properties: {
32-
all: {
33-
type: 'boolean',
34-
description: 'Show all containers (default shows all containers including stopped ones)'
35-
}
36-
},
37-
required: []
38-
)
30+
param :all, type: :boolean, desc: 'Show all containers (default shows all containers including stopped ones)',
31+
required: false
3932

4033
# List all Docker containers with detailed information.
4134
#
@@ -57,11 +50,9 @@ class ListContainers < RubyLLM::Tool
5750
# # Returns detailed info for all containers
5851
#
5952
# @see Docker::Container.all
60-
def self.call(server_context:, all: true)
61-
RubyLLM::Tool::Response.new([{
62-
type: 'text',
63-
text: Docker::Container.all(all: all).map(&:info).to_s
64-
}])
53+
def execute(all: true)
54+
require 'docker'
55+
::Docker::Container.all(all: all).map(&:info).to_s
6556
end
6657
end
6758
end

0 commit comments

Comments
 (0)