Class: LLM::Tool::Chdir

Inherits:
LLM::Tool show all
Defined in:
lib/llm/tools/chdir.rb

Overview

The LLM::Tool::Chdir class implements a tool that can change the current working directory.

Instance Method Summary collapse

Methods inherited from LLM::Tool

a2a, a2a?, #a2a?, clear_registry!, description, find_by_name!, function, #function, inherited, mcp, mcp?, #mcp?, name, #on_cancel, #on_interrupt, params, register, registry, skill?, #skill?, unregister

Methods included from Param

#param, #required

Methods included from Function::Registry

#clear_registry!, extended, #find_by_name, #lock, #register, #registry, #registry_key, #tool_name, #unregister

Instance Method Details

#call(path:) ⇒ Hash

Parameters:

  • path (String)

Returns:

  • (Hash)


18
19
20
21
# File 'lib/llm/tools/chdir.rb', line 18

def call(path:)
  Dir.chdir(path)
  {ok: true, cwd: path}
end