Get Tool Schema • AI Agent SDK
get_tool_schema: Get OpenAI-compatible schema for any tool-like object.
get_tool_schema
Function
</div>
This function is defined in the decorator module.
Get OpenAI-compatible schema for any tool-like object.
Supports:
- BaseTool instances
- FunctionTool instances
- Plain functions (generates schema from signature)
- LangChain tools
- CrewAI tools
Signature
def get_tool_schema(obj: Any) -> Optional[Dict[str, Any]]Parameters
ParamField
AnyNo description available.
Returns
ResponseField
Optional[Dict[str, Any]]The result of the operation.
Uses
obj.get_schemacallable
Used By
Source
View on GitHubpraisonaiagents/tools/decorator.py at line 442