Get Tool Definitions • AI Agent SDK

get_tool_definitions: Get OpenAI-compatible tool definitions with dynamic schema overrides applied.

get_tool_definitions

Method

</div>

This is a method of the ToolRegistry class in the registry module.

Get OpenAI-compatible tool definitions with dynamic schema overrides applied.

This is the main entry point for getting tool schemas that respects dynamic overrides. Called every time tools need to be passed to the LLM.

Diagram

uses

returns

Agent

Tool: get_tool_definitions

Result

Signature

python
def get_tool_definitions(permission_resolver: Optional[Callable[[str], bool]]) -> List[Dict[str, Any]]

Parameters

ParamField Optional

Optional callable `(tool_name) -&gt; bool that returns False when a tool is denied for the current agent/session. Denied tools are dropped from the advertised schema, mirroring the existing check_availability() filter (deny = hide). None` (default) advertises every available tool, preserving backward compatibility.

Returns

ResponseField List[Dict[str, Any]]

List of OpenAI-compatible tool definition dictionaries

Uses

  • check_availability
  • logging.debug
  • logging.warning
  • permission_resolver
  • logging.error

Source

View on GitHub

praisonaiagents/tools/registry.py at line 254


Related Documentation