JSONTool

org.llm4s.toolapi.builtin.core.JSONTool
object JSONTool

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)
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
JSONTool.type

Members list

Value members

Concrete fields

val tool: ToolFunction[Map[String, Any], JSONResult]

The JSON tool instance.

The JSON tool instance.

Attributes