Class: LLM::Tool::Mkdir

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

Overview

The LLM::Tool::Mkdir class implements a tool that can create a tree of new directories.

Instance Method Summary collapse

Methods inherited from LLM::Tool

NotFound, a2a, a2a?, #a2a?, abstract!, abstract?, clear_registry!, description, find_by_name!, #function, function, inherited, mcp, #mcp?, mcp?, name, #on_cancel, #on_interrupt, params, register, registry, set, subclasses, unregister

Methods included from Param

#defaults, #param, #required

Methods included from Function::Registry

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

Instance Method Details

#call(path:, max_bytes: Exec.max_bytes) ⇒ Hash

Parameters:

  • path (String)

Returns:

  • (Hash)


21
22
23
24
25
26
27
# File 'lib/llm/tools/mkdir.rb', line 21

def call(path:, max_bytes: Exec.max_bytes)
  Exec.new.call(
    command: "mkdir",
    arguments: ["-p", path],
    max_bytes:
  )
end