orxtra v0.13.0 /tool.src.orxtra.tool._data_tool_shared
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

python
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

python
def validate_args(args: dict[str, Any], params: dict[str, ParamDef]) -> None

Validate that required params are present and no unexpected args.

Raises ToolError on missing required params or unexpected args.

#validate_output_schema

python
def validate_output_schema(response_data: Any, schema: dict[str, Any]) -> None

Validate response data against the output JSON Schema.

Raises ToolError with a descriptive message on validation failure.

Search