glean/json_value
Types
Values
pub fn arguments_to_object(arguments_json: String) -> json.Json
Turn a tool call’s argument string into a JSON object for APIs that
take arguments as an object (Anthropic input, Gemini args).
Arguments that aren’t a JSON object can’t be sent as-is. They were
already reported to the model as invalid when the tool call ran, so they
are sent back wrapped as {"invalid_arguments": "<original text>"}
rather than dropped, keeping the history truthful.