Validate Tool Schema Consistency • AI Agent SDK
validate_tool_schema_consistency: Validate a list of tools for schema consistency with OpenAI format.
validate_tool_schema_consistency
Function
</div>
This function is defined in the base module.
Validate a list of tools for schema consistency with OpenAI format.
This function ensures all tools in a list can be properly serialized and have consistent schema structures for use with LLM providers.
Signature
def validate_tool_schema_consistency(tools: List[Any], return_schemas: bool) -> AnyParameters
ParamField
List[Any]List of tool objects to validate
ParamField
boolIf True, return the list of built schemas instead of just a boolean, so callers can reuse them without rebuilding.
Returns
ResponseField
AnyTrue if all tools are valid and consistent (or the built schemas list when `return_schemas` is True)
Exceptions
ToolValidationError
If validation fails
Uses
validate_toolToolValidationErrorjson.dumpsnames.add
Used By
Source
View on GitHubpraisonaiagents/tools/base.py at line 530