{"record":{"id":"2ff986764a28b333","repo":"langchain-ai/langgraph","slug":"no-message-found-in-input","errorCode":null,"errorMessage":"No message found in input","messagePattern":"No message found in input","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/prebuilt/langgraph/prebuilt/tool_node.py","lineNumber":1255,"sourceCode":"            isinstance(input, dict) and input.get(\"__type\") == \"tool_call_with_context\"\n        ):\n            # Handle ToolCallWithContext from Send API\n            # Type checkers cannot narrow correctly since the signature\n            # for input contains dict[str, Any]. We'd need to narrow dict[str, Any]\n            # before we can apply correct typing.\n            input_with_ctx = cast(\"ToolCallWithContext\", input)\n            input_type = \"tool_calls\"\n            return [input_with_ctx[\"tool_call\"]], input_type\n        elif isinstance(input, dict) and (\n            messages := input.get(self._messages_key, [])\n        ):\n            input_type = \"dict\"\n        elif messages := getattr(input, self._messages_key, []):\n            # Assume dataclass-like state that can coerce from dict\n            input_type = \"dict\"\n        else:\n            msg = \"No message found in input\"\n            raise ValueError(msg)\n\n        try:\n            latest_ai_message = next(\n                m for m in reversed(messages) if isinstance(m, AIMessage)\n            )\n        except StopIteration:\n            msg = \"No AIMessage found in input\"\n            raise ValueError(msg)\n\n        tool_calls = list(latest_ai_message.tool_calls)\n        return tool_calls, input_type\n\n    def _validate_tool_call(self, call: ToolCall) -> ToolMessage | None:\n        requested_tool = call[\"name\"]\n        if requested_tool not in self.tools_by_name:\n            all_tool_names = list(self.tools_by_name.keys())\n            content = INVALID_TOOL_NAME_ERROR_TEMPLATE.format(\n                requested_tool=requested_tool,","sourceCodeStart":1237,"sourceCodeEnd":1273,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/prebuilt/langgraph/prebuilt/tool_node.py#L1237-L1273","documentation":"Error \"No message found in input\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/prebuilt/langgraph/prebuilt/tool_node.py:1255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}