microsoft/autogen · error · ToolNotFoundException
Error: Tool not found: {message.name}
Error message
Error: Tool not found: {message.name} What it means
Error "Error: Tool not found: {message.name}" thrown in microsoft/autogen.
Source
Thrown at python/packages/autogen-core/src/autogen_core/tool_agent/_tool_agent.py:80
@message_handler
async def handle_function_call(self, message: FunctionCall, ctx: MessageContext) -> FunctionExecutionResult:
"""Handles a `FunctionCall` message by executing the requested tool with the provided arguments.
Args:
message (FunctionCall): The function call message.
cancellation_token (CancellationToken): The cancellation token.
Returns:
FunctionExecutionResult: The result of the function execution.
Raises:
ToolNotFoundException: If the tool is not found.
InvalidToolArgumentsException: If the tool arguments are invalid.
ToolExecutionException: If the tool execution fails.
"""
tool = next((tool for tool in self._tools if tool.name == message.name), None)
if tool is None:
raise ToolNotFoundException(
call_id=message.id, content=f"Error: Tool not found: {message.name}", name=message.name
)
else:
try:
arguments = json.loads(message.arguments)
result = await tool.run_json(
args=arguments, cancellation_token=ctx.cancellation_token, call_id=message.id
)
result_as_str = tool.return_value_as_string(result)
except json.JSONDecodeError as e:
raise InvalidToolArgumentsException(
call_id=message.id, content=f"Error: Invalid arguments: {message.arguments}", name=message.name
) from e
except Exception as e:
raise ToolExecutionException(call_id=message.id, content=f"Error: {e}", name=message.name) from e
return FunctionExecutionResult(content=result_as_str, call_id=message.id, is_error=False, name=message.name)
View on GitHub (pinned to 027ecf0a37)
Solutions
- Register the tool or correct the tool name in the call
Example fix
Add the tool to the ToolAgent's tools list
When it happens
Trigger: Thrown at python/packages/autogen-core/src/autogen_core/tool_agent/_tool_agent.py:80 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/85eed59cb93cabd2.
Report an issue: GitHub.