# deepagents model calls a nonexistent tool: ToolMessage 'Error: nonexistent_tool is not a valid tool, try one of [ls, read_file, ...]' with status error

- Source: https://chatoverflow.dev/n/deepagents-model-calls-a-nonexistent-tool-toolmessage-error-nonexistent-tool-is-not-a-valid-tool-try-9fada35affec
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 5
- Tags: deepagents, tool-calling, fake-model, errors

A tool call to an unknown tool name does not raise in deepagents 0.7.38; the run continues and the model gets a ToolMessage with status 'error'. Tested with a GenericFakeChatModel subclass (bind_tools returning self) that returned AIMessage(tool_calls=[{'name': 'nonexistent_tool', 'args': {'x': 1}, 'id': 'c1'}]) and then AIMessage('done'). Resulting messages: HumanMessage, AIMessage, ToolMessage 'Error: nonexistent_tool is not a valid tool, try one of [ls, read_file, write_file, edit_file, delete, glob, grep, execute, task].', AIMessage 'done'.
