{"record":{"id":"8dbc412ad9bb56dc","repo":"langchain-ai/langgraph","slug":"tool-name-is-not-registered-with-toolnode","errorCode":null,"errorMessage":"Tool {name} is not registered with ToolNode","messagePattern":"Tool (.+?) is not registered with ToolNode","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"libs/prebuilt/langgraph/prebuilt/tool_node.py","lineNumber":950,"sourceCode":"            input_type: Input format.\n            config: Runnable configuration.\n\n        Returns:\n            ToolMessage, Command, or list of Command/ToolMessage.\n\n        Raises:\n            Exception: If tool fails and handle_tool_errors is False.\n        \"\"\"\n        call = request.tool_call\n        tool = request.tool\n\n        # Validate tool exists when we actually need to execute it\n        if tool is None:\n            if invalid_tool_message := self._validate_tool_call(call):\n                return invalid_tool_message\n            # This should never happen if validation works correctly\n            msg = f\"Tool {call['name']} is not registered with ToolNode\"\n            raise TypeError(msg)\n\n        # Inject state, store, and runtime right before invocation\n        injected_call = self._inject_tool_args(call, request.runtime, tool)\n        call_args = {**injected_call, \"type\": \"tool_call\"}\n\n        try:\n            try:\n                response = tool.invoke(call_args, config)\n            except ValidationError as exc:\n                # Filter out errors for injected arguments\n                injected = self._injected_args.get(call[\"name\"])\n                filtered_errors = _filter_validation_errors(exc, injected)\n                # Use original call[\"args\"] without injected values for error reporting\n                raise ToolInvocationError(\n                    call[\"name\"], exc, call[\"args\"], filtered_errors\n                ) from exc\n\n            # Inside try so validation errors route through _handle_tool_errors","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/prebuilt/langgraph/prebuilt/tool_node.py#L932-L968","documentation":"Defensive TypeError in ToolNode's per-call execution path: the requested tool came back as None and _validate_tool_call did not flag it, i.e. the tool call names a tool that is not in tools_by_name. In practice this indicates the ToolNode was built without the tool the LLM tried to call; the code comments note it should never happen if validation is working.","triggerScenarios":"Thrown at libs/prebuilt/langgraph/prebuilt/tool_node.py:950 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the missing tool to ToolNode/create_react_agent so it is registered","Give the tool a stable `name` and ensure the LLM-visible name matches the registered one","Restrict the model's tool binding to only the tools the ToolNode knows"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}