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
Diagram

uses

returns

Agent

Tool: get_tool_schema

Result

Signature

python
def get_tool_schema(obj: Any) -> Optional[Dict[str, Any]]

Parameters

ParamField Any

No description available.

Returns

ResponseField Optional[Dict[str, Any]]

The result of the operation.

Uses

  • obj.get_schema
  • callable

Used By

Source

View on GitHub

praisonaiagents/tools/decorator.py at line 442


Related Documentation