Skip to main content

validate_tool_arguments

Function validate_tool_arguments 

Source
pub fn validate_tool_arguments(
    tool_name: &str,
    schema: &Value,
    args: &Value,
) -> Result<(), String>
Expand description

Validate tool arguments against its JSON Schema (matching pi’s validateToolArguments).

Returns Ok(()) on success, or Err with pi-compatible format:

Validation failed for tool "edit":
  - path: Required
  - edits[0].oldText: Required

Received arguments:
{
  "path": "/foo.txt"
}