Quick Start
1
Get a suggestion
2
Fail fast in CI
3
Route suggestions yourself
How It Works
Every tool name passes throughresolve_tool_names, which looks it up, and on a miss computes the closest known names.
Suggestions use
difflib.get_close_matches with a cutoff of 0.6 and up to 3 names per unknown tool.get_registry().list_tools()), the built-in TOOL_MAPPINGS keys, and praisonai_tools.__all__ when the extra is installed.
Agent.__init__ routes a list/tuple tools= through the per-element resolver, so name strings resolve regardless of whether callables are also present.
Accepted tool shapes
Atools=[...] element can now be a plain function, a callable class instance, or a BaseTool-style instance.
BaseTool-style instances — anything exposing a
.name attribute and a .run method, such as ClarifyTool — are accepted alongside plain functions and callable classes. When a callable tool also carries a .name attribute, .name wins over __name__.
Mixed tools lists
Onetools=[...] list can freely mix callables and tool-name strings.
Resolve a mixed list yourself
Callresolve_tools_list() to resolve a possibly-mixed list without building an agent.
resolve_tool_names() is unchanged and now delegates to resolve_tools_list(), so existing code is unaffected.
Choosing a Mode
Pick the behaviour that matches where your agent runs.Configuring Strict Mode
Turn strict mode on with an environment variable, a keyword argument, or a callback.- Environment variable
- Argument
- Callback
strict is left unset:
The ToolResolutionError Shape
Strict mode raises ToolResolutionError, carrying the unknown names and their suggestions.
ToolResolutionError subclasses ValueError, so existing except ValueError: blocks still catch it.
Strict mode also applies to
Agent(toolsets=[...]) — the toolset code path re-raises ToolResolutionError intact, preserving .unknown and .suggestions.Common Patterns
Break the build on a typo in CI, then keep exploration friendly locally.Best Practices
Turn on strict mode in CI
Turn on strict mode in CI
Add
PRAISONAI_STRICT_TOOLS=true to your CI environment so a mistyped tool name breaks the build instead of quietly shipping a tool-less agent.Keep warn-and-continue for exploration
Keep warn-and-continue for exploration
Interactive exploration works better with the default — you get the “did you mean …?” hint without losing the running session.
Route suggestions through your own stack
Route suggestions through your own stack
For long-running services,
on_unknown sends the suggestion through the logger or alerting your app already uses.Install praisonai-tools for richer suggestions
Install praisonai-tools for richer suggestions
The suggestion catalogue unions the registry,
TOOL_MAPPINGS, and praisonai_tools.__all__. Installing praisonai-tools broadens the pool suggestions come from.Gateway operators: use the start-time tool pre-flight
Gateway operators: use the start-time tool pre-flight
PRAISONAI_STRICT_TOOLS here is the core resolver gate — it raises ToolResolutionError when Agent.__init__ builds tools. The gateway adds a complementary wrapper-level gate one layer up: praisonai gateway start --strict-tools (default on) validates every tool named in gateway.yaml before the gateway binds, failing fast with exit 78. It uses the wrapper resolver (praisonai_code/tool_resolver.py), not this core resolver. See Pre-flight tool check.Related
Allowed Tools
Restrict which tools an agent can call.
Tool Resolver
How tool names map to callables across sources.
Tool Call Self-Repair
Runtime auto-fix when the LLM emits a drifted tool name during a run.
Gateway Pre-flight Tool Check
Wrapper-level
--strict-tools gate — fail fast at gateway start (exit 78).
