org.llm4s.toolapi.builtin.core

Core utility tools that require no external dependencies or API keys.

These tools provide common functionality for agent workflows:

Attributes

Example
import org.llm4s.toolapi.builtin.core._
import org.llm4s.toolapi.ToolRegistry
val coreTools = new ToolRegistry(Seq(
 DateTimeTool.tool,
 CalculatorTool.tool,
 UUIDTool.tool,
 JSONTool.tool
))

Members list

Type members

Classlikes

case class CalculatorResult(expression: String, result: Double, formatted: String)

Result from calculator operations.

Result from calculator operations.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self 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

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 Object
trait Matchable
class Any
Self type
case class DateTimeComponents(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int, dayOfWeek: String)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class DateTimeResult(datetime: String, timezone: String, timestamp: Long, iso8601: String, components: DateTimeComponents)

Result from date/time operations.

Result from date/time operations.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object DateTimeTool

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 Object
trait Matchable
class Any
Self type
case class JSONResult(success: Boolean, result: Value, formatted: String)

Result from JSON operations.

Result from JSON operations.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object JSONResult

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JSONResult.type
object JSONTool

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

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 Object
trait Matchable
class Any
Self type
JSONTool.type
case class UUIDResult(uuid: String, version: Int, variant: String)

Result from UUID generation.

Result from UUID generation.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object UUIDResult

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
UUIDResult.type
object UUIDTool

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 Object
trait Matchable
class Any
Self type
UUIDTool.type

Value members

Concrete fields

val allTools: Seq[ToolFunction[_, _]]

All core utility tools combined into a sequence.

All core utility tools combined into a sequence.

Attributes