org.llm4s.toolapi
Members list
Packages
Built-in tools for common agent operations.
Built-in tools for common agent operations.
This package provides production-ready tools that can be used out of the box:
== Core Utilities (No API Keys Required) ==
import org.llm4s.toolapi.builtin.core._
val tools = new ToolRegistry(Seq(
DateTimeTool.tool,
CalculatorTool.tool,
UUIDTool.tool,
JSONTool.tool
))
== File System Tools ==
import org.llm4s.toolapi.builtin.filesystem._
val fileTools = new ToolRegistry(Seq(
ReadFileTool.create(FileConfig(
maxFileSize = 512 * 1024,
allowedPaths = Some(Seq("/tmp"))
)),
ListDirectoryTool.tool,
FileInfoTool.tool
))
== HTTP Tools ==
import org.llm4s.toolapi.builtin.http._
val httpTools = new ToolRegistry(Seq(
HTTPTool.create(HttpConfig(
timeoutMs = 10000,
allowedDomains = Some(Seq("api.example.com"))
))
))
== Shell Tools ==
import org.llm4s.toolapi.builtin.shell._
// Read-only shell (safe commands)
val shellTools = new ToolRegistry(Seq(
ShellTool.create(ShellConfig.readOnly())
))
// Development shell with common dev tools
val devShellTools = new ToolRegistry(Seq(
ShellTool.create(ShellConfig.development())
))
== Search Tools ==
import org.llm4s.toolapi.builtin.search._
val searchTools = new ToolRegistry(Seq(
WebSearchTool.tool
))
== All Built-in Tools ==
import org.llm4s.toolapi.builtin.BuiltinTools
// Get all safe tools (no shell, restricted filesystem)
val tools = BuiltinTools.safe()
// Get all tools with custom config
val allTools = BuiltinTools.all(
fileConfig = FileConfig(allowedPaths = Some(Seq("/tmp")))
)
Attributes
- See also
-
org.llm4s.toolapi.builtin.core for core utility tools
org.llm4s.toolapi.builtin.filesystem for file system tools
org.llm4s.toolapi.builtin.http for HTTP tools
org.llm4s.toolapi.builtin.shell for shell tools
org.llm4s.toolapi.builtin.search for search tools
Type members
Classlikes
Array schema with validation options
Array schema with validation options
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Helper class to convert ToolRegistry to Azure OpenAI format
Helper class to convert ToolRegistry to Azure OpenAI format
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AzureToolHelper.type
Boolean schema
Boolean schema
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SchemaDefinition[Boolean]class Objecttrait Matchableclass AnyShow all
Integer schema with validation options
Integer schema with validation options
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SchemaDefinition[Int]class Objecttrait Matchableclass AnyShow all
Nullable schema wrapper
Nullable schema wrapper
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Number schema with validation options
Number schema with validation options
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SchemaDefinition[Double]class Objecttrait Matchableclass AnyShow all
Object schema with properties
Object schema with properties
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SchemaDefinition[T]class Objecttrait Matchableclass AnyShow all
Property definition for object schemas
Property definition for object schemas
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Safe parameter extraction with type checking and path navigation.
Safe parameter extraction with type checking and path navigation.
This extractor provides two modes of operation:
- Simple mode: Returns Either[String, T] for backward compatibility
- Enhanced mode: Returns Either[ToolParameterError, T] for structured error reporting
Value parameters
- params
-
The JSON parameters to extract from
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
Schema builder - fluent API for creating schema definitions
Schema builder - fluent API for creating schema definitions
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Schema.type
Base trait for all schema definitions
Base trait for all schema definitions
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ArraySchema[A]class BooleanSchemaclass IntegerSchemaclass NullableSchema[T]class NumberSchemaclass ObjectSchema[T]class StringSchemaShow all
String schema with validation options
String schema with validation options
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SchemaDefinition[String]class Objecttrait Matchableclass AnyShow all
Builder for tool definitions
Builder for tool definitions
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ToolBuilder.type
Enhanced tool call errors with consistent formatting
Enhanced tool call errors with consistent formatting
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ExecutionErrorclass HandlerErrorclass InvalidArgumentsclass NullArgumentsclass UnknownFunction
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ToolCallError.type
Request model for tool calls
Request model for tool calls
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Strategy for executing multiple tool calls.
Strategy for executing multiple tool calls.
When an LLM requests multiple tool calls, they can be executed either sequentially (one at a time) or in parallel (simultaneously).
Attributes
- Example
-
// Execute tools in parallel agent.runWithStrategy( query = "Get weather in London, Paris, and Tokyo", tools = weatherTools, toolExecutionStrategy = ToolExecutionStrategy.Parallel ) // Limit concurrency to 2 at a time agent.runWithStrategy( query = "Search 10 different topics", tools = searchTools, toolExecutionStrategy = ToolExecutionStrategy.ParallelWithLimit(2) ) - Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
Core model for tool function definitions
Core model for tool function definitions
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Structured error information for tool parameter validation
Structured error information for tool parameter validation
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class InvalidNestingclass MissingParameterclass MultipleErrorsclass NullParameterclass TypeMismatch
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ToolParameterError.type
Registry for tool functions with execution capabilities.
Registry for tool functions with execution capabilities.
Supports both synchronous and asynchronous tool execution:
execute()- Synchronous, blocking execution (original API)executeAsync()- Asynchronous, non-blocking executionexecuteAll()- Batch execution with configurable strategy
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class MCPToolRegistry
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ToolRegistry.type