BuiltinTools

org.llm4s.toolapi.builtin.BuiltinTools
object BuiltinTools

Aggregator for built-in tools with convenient factory methods.

Provides pre-configured tool sets for common use cases:

  • safe(): Core utilities, web search, and read-only HTTP (no file or shell access)
  • withFiles(): Safe tools plus read-only file system access
  • development(): All tools including shell with common dev commands

Attributes

Example
import org.llm4s.toolapi.ToolRegistry
import org.llm4s.toolapi.builtin.BuiltinTools
// Safe tools for production use
for {
 tools <- BuiltinTools.withHttpSafe()
} yield new ToolRegistry(tools)
// Development tools with file and shell access
for {
 tools <- BuiltinTools.developmentSafe(
   workingDirectory = Some("/home/user/project")
 )
} yield new ToolRegistry(tools)
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def coreSafe: Result[Seq[ToolFunction[_, _]]]

Core utility tools (always safe, no external dependencies), returning a Result for safe error handling.

Core utility tools (always safe, no external dependencies), returning a Result for safe error handling.

Includes:

  • DateTimeTool: Get current date/time
  • CalculatorTool: Math operations
  • UUIDTool: Generate UUIDs
  • JSONTool: Parse/format/query JSON

Attributes

def customSafe(fileConfig: Option[FileConfig], writeConfig: Option[WriteConfig], httpConfig: Option[HttpConfig], shellConfig: Option[ShellConfig]): Result[Seq[ToolFunction[_, _]]]

Custom tool set with full configuration control, returning a Result for safe error handling.

Custom tool set with full configuration control, returning a Result for safe error handling.

Value parameters

fileConfig

Configuration for read operations

httpConfig

HTTP configuration

shellConfig

Optional shell configuration (if None, shell tool is not included)

writeConfig

Optional write configuration (if None, write tool is not included)

Attributes

def developmentSafe(workingDirectory: Option[String], fileAllowedPaths: Seq[String]): Result[Seq[ToolFunction[_, _]]]

Development tools with full read/write and shell access, returning a Result for safe error handling.

Development tools with full read/write and shell access, returning a Result for safe error handling.

Includes:

  • All core utilities
  • Full HTTP access
  • File system read/write
  • Shell with common dev commands

WARNING: These tools have significant access to the system. Use only in trusted development environments.

Value parameters

fileAllowedPaths

Allowed paths for file write operations

workingDirectory

Optional working directory for file/shell operations

Attributes

def withFilesSafe(fileConfig: FileConfig, httpConfig: HttpConfig): Result[Seq[ToolFunction[_, _]]]

Safe tools plus read-only file system access, returning a Result for safe error handling.

Safe tools plus read-only file system access, returning a Result for safe error handling.

Includes:

  • All safe tools
  • Read-only file system tools (read, list, info)

Does NOT include:

  • File writing
  • Shell access

Attributes

def withHttpSafe(httpConfig: HttpConfig): Result[Seq[ToolFunction[_, _]]]

Safe tools for production use, returning a Result for safe error handling.

Safe tools for production use, returning a Result for safe error handling.

Includes:

  • All core utilities
  • Read-only HTTP with localhost blocked

Does NOT include:

  • File system access
  • Shell access
  • Web search (configure separately at application edge)

Attributes