Skip to main content
resolve_tools() from praisonai.templates.tool_override delegates name resolution to the canonical ToolResolver. It preserves the registry= override layer and the PRAISONAI_ALLOW_TEMPLATE_TOOLS security gate for template-dir tools.py autoload, then falls back to name-variation matching (lowercase, _/-, _tool, Tool suffix) when the canonical lookup misses. Tools previously invisible to recipe/template resolution are now reachable:
  • Wrapper ToolRegistry.register_function() registrations
  • Tools from the praisonai-tools external package
  • Core SDK plugin-registered tools

Code Usage

from praisonai.templates.tool_override import (
    create_tool_registry_with_overrides,
    resolve_tools,
)

# Create registry
registry = create_tool_registry_with_overrides(include_defaults=True)

# Resolve tool names to callables
tools = resolve_tools(["shell_tool", "internet_search"], registry=registry)

# Check resolution
for tool in tools:
    print(f"Resolved: {tool.__name__} from {tool.__module__}")
from praisonai.templates.tool_override import resolve_tools

# Resolve with custom registry
registry = create_tool_registry_with_overrides(
    override_files=["my_tools.py"],
    tools_sources=["praisonai_tools.video"],
)

tools = resolve_tools(["my_custom_tool"], registry=registry)
resolve_tools() no longer implicitly loads <template_dir>/tools.py unless PRAISONAI_ALLOW_TEMPLATE_TOOLS=1. See Tools Override → Security for details.
Canonical resolution chain: resolve_tools() is a thin wrapper around ToolResolver with a registry-override layer on top. See Templates Module → Tool Override for programmatic usage.Alternative Tool Resolution: For YAML-based tool resolution with per-agent isolation, see YAML Tools - Tool Resolver which uses the praisonai.tool_resolver module directly.CLI flag (--tools name1,name2) also goes through praisonai.tool_resolver.ToolResolver (PR #1857). Recipe and template tools: lists share the same five-source chain as of PR #2059.