ToolCallErrorJson
org.llm4s.toolapi.ToolCallErrorJson
object ToolCallErrorJson
JSON serialization helpers for structured tool error payloads.
Converts ToolCallError and ToolParameterError instances to machine-readable JSON format for ToolMessage.content, enabling LLMs and consumers to programmatically parse validation errors and self-correct tool arguments.
Output schema:
{
"isError": true,
"toolName": "<string>",
"errorType": "<unknown_function|null_arguments|invalid_arguments|handler_error|execution_error>",
"message": "<human readable summary>",
"parameterErrors": [ // optional: only present for invalid_arguments
{
"parameterName": "<string>",
"kind": "<missing_parameter|null_parameter|type_mismatch|invalid_nesting>",
"expectedType": "<string|null>",
"receivedType": "<string|null>",
"availableParameters": ["<string>", ...] // optional hint
}
],
"error": "<legacy error string for older consumers>"
}
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ToolCallErrorJson.type
Members list
In this article