Skip to main content

parse_output_schema

Function parse_output_schema 

Source
pub fn parse_output_schema(
    value: Option<&Value>,
) -> Result<Option<Value>, String>
Expand description

Parse a tool’s output argument into the JSON Schema it requests.

Two shapes are accepted:

  • a record of field-name → type-descriptor strings ("str", "int", "float", "bool", "record", or "list[...]" of those), compiled into a strict object schema; or
  • a Lashlang Type { ... } literal — a single-field {"$lash_type": <schema>} wrapper as produced by the Lashlang compiler — whose inner schema is passed through after validation.

Returns Ok(None) when output is absent or null (the tool falls back to its untyped default).