Skip to main content
Typo a tool name and PraisonAI tells you what you meant — and, with strict mode on, refuses to start until you fix it.

Quick Start

1

Get a suggestion

2

Fail fast in CI

3

Route suggestions yourself


How It Works

Every tool name passes through resolve_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.
The suggestion catalogue is the union of the registry (get_registry().list_tools()), the built-in TOOL_MAPPINGS keys, and praisonai_tools.__all__ when the extra is installed.

Accepted tool shapes

A tools=[...] 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__.

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.
The signature reads the environment variable only when 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.
The default is non-strict and backward-compatible: unknown names are dropped and resolved tools returned, now with a user-visible warning and suggestions.

Common Patterns

Break the build on a typo in CI, then keep exploration friendly locally.
Ship suggestions through your own logging or alerting for long-running services.

Best Practices

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.
Interactive exploration works better with the default — you get the “did you mean …?” hint without losing the running session.
For long-running services, on_unknown sends the suggestion through the logger or alerting your app already uses.
The suggestion catalogue unions the registry, TOOL_MAPPINGS, and praisonai_tools.__all__. Installing praisonai-tools broadens the pool suggestions come from.

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.