org.llm4s.toolapi.builtin.core
Core utility tools that require no external dependencies or API keys.
These tools provide common functionality for agent workflows:
- DateTimeTool: Get current date/time in any timezone
- CalculatorTool: Perform mathematical calculations
- UUIDTool: Generate unique identifiers
- JSONTool: Parse, format, and query JSON data
Attributes
- Example
-
import org.llm4s.toolapi.builtin.core._ import org.llm4s.toolapi.ToolRegistry // Recommended: Safe API returning Result for { dateTime <- DateTimeTool.toolSafe calculator <- CalculatorTool.toolSafe uuid <- UUIDTool.toolSafe json <- JSONTool.toolSafe } yield new ToolRegistry(Seq(dateTime, calculator, uuid, json)) // Or use the convenience val allToolsSafe.map(tools => new ToolRegistry(tools))
Members list
Type members
Classlikes
Result from calculator operations.
Result from calculator operations.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
CalculatorResult.type
Tool for performing mathematical calculations.
Tool for performing mathematical calculations.
Supports:
- Basic arithmetic: add, subtract, multiply, divide
- Power and square root
- Percentage calculations
- Absolute value, min, max
A result that is not a finite number (an overflow such as 10^400, or an undefined power such as (-8)^(1/3)) is reported as an error, as division by zero is. The formatted text always uses . as the decimal separator and ASCII digits, whatever the JVM's default locale is.
Attributes
- Example
-
import org.llm4s.toolapi.builtin.core.CalculatorTool val tools = new ToolRegistry(Seq(CalculatorTool.tool)) agent.run("What is 15% of 250?", tools) - Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CalculatorTool.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Result from date/time operations.
Result from date/time operations.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
DateTimeResult.type
Tool for getting current date and time information.
Tool for getting current date and time information.
Features:
- Current date/time in any timezone
- Multiple output formats (ISO, human-readable)
- Timestamp conversion
- Date component extraction
Attributes
- Example
-
import org.llm4s.toolapi.builtin.core.DateTimeTool val tools = new ToolRegistry(Seq(DateTimeTool.tool)) agent.run("What is the current time in Tokyo?", tools) - Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DateTimeTool.type
Result from JSON operations.
Result from JSON operations.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
JSONResult.type
Tool for JSON parsing, formatting, and querying.
Tool for JSON parsing, formatting, and querying.
Operations:
- parse: Parse JSON string into structured data
- format: Pretty-print JSON
- query: Extract value using path (e.g., "data.users[0].name")
- validate: Check if string is valid JSON
Limits and errors: a document nested more than 512 levels deep (arrays and objects counted together) is refused by every operation with an error instead of being read or written, because pretty-printing recurses once per level. A query path must be read completely: an empty segment (a..b, a.), an index that is not a non-negative whole number (a[x], a[-1]), or any other text the path syntax does not cover is an error naming the text it stopped at, and an array index too large for an Int is an error naming the index.
Attributes
- Example
-
import org.llm4s.toolapi.builtin.core.JSONTool val tools = new ToolRegistry(Seq(JSONTool.tool)) agent.run("Parse this JSON and extract the user's email", tools) - Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JSONTool.type
Result from UUID generation.
Result from UUID generation.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
UUIDResult.type
Tool for generating UUIDs.
Tool for generating UUIDs.
Generates standard UUID v4 (random) identifiers.
Attributes
- Example
-
import org.llm4s.toolapi.builtin.core.UUIDTool val tools = new ToolRegistry(Seq(UUIDTool.tool)) agent.run("Generate a unique ID for this transaction", tools) - Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
UUIDTool.type
Value members
Concrete fields
All core utility tools combined into a sequence, returning a Result for safe error handling.
All core utility tools combined into a sequence, returning a Result for safe error handling.