On this page
Shared helpers for data-defined tool factories: build_json_schema_params derives the LLM-visible schema from ParamDef entries, validate_args checks required/unexpected arguments, validate_output_schema checks responses via jsonschema.
#tool.src.orxtra.tool._data_tool_shared
#tool.src.orxtra.tool._data_tool_shared
Shared utilities for data-defined tool execution factories.
Functions here are used by both _data_tool_http and _data_tool_monty (and any future execution-type factories).
#build_json_schema_params
def build_json_schema_params(params: dict[str, ParamDef]) -> dict[str, Any]Build a JSON Schema parameters dict from ParamDef entries.
This is the schema the LLM sees for tool-call arguments.
#validate_args
def validate_args(args: dict[str, Any], params: dict[str, ParamDef]) -> NoneValidate that required params are present and no unexpected args.
Raises ToolError on missing required params or unexpected args.
#validate_output_schema
def validate_output_schema(response_data: Any, schema: dict[str, Any]) -> NoneValidate response data against the output JSON Schema.
Raises ToolError with a descriptive message on validation failure.