{"record":{"id":"d8d15682663bf51a","repo":"langchain-ai/langgraph","slug":"validation-node-only-works-with-tools-that-have-a","errorCode":null,"errorMessage":"Validation node only works with tools that have a pydantic BaseModel args_schema. Got {schema.name} with args_schema: {schema.args_schema}.","messagePattern":"Validation node only works with tools that have a pydantic BaseModel args_schema\\. Got (.+?) with args_schema: (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/prebuilt/langgraph/prebuilt/tool_validator.py","lineNumber":151,"sourceCode":"            format_error: A function that takes an exception, a ToolCall, and a schema\n                and returns a formatted error string. By default, it returns the\n                exception repr and a message to respond after fixing validation errors.\n            name: The name of the node.\n            tags: A list of tags to add to the node.\n        \"\"\"\n        super().__init__(self._func, None, name=name, tags=tags, trace=False)\n        self._format_error = format_error or _default_format_error\n        self.schemas_by_name: dict[str, type[BaseModel]] = {}\n        for schema in schemas:\n            if isinstance(schema, BaseTool):\n                if schema.args_schema is None:\n                    raise ValueError(\n                        f\"Tool {schema.name} does not have an args_schema defined.\"\n                    )\n                elif not isinstance(\n                    schema.args_schema, type\n                ) or not is_basemodel_subclass(schema.args_schema):\n                    raise ValueError(\n                        \"Validation node only works with tools that have a pydantic BaseModel args_schema. \"\n                        f\"Got {schema.name} with args_schema: {schema.args_schema}.\"\n                    )\n                self.schemas_by_name[schema.name] = schema.args_schema\n            elif isinstance(schema, type) and issubclass(\n                schema, (BaseModel, BaseModelV1)\n            ):\n                self.schemas_by_name[schema.__name__] = cast(type[BaseModel], schema)\n            elif callable(schema):\n                base_model = create_schema_from_function(\"Validation\", schema)\n                self.schemas_by_name[schema.__name__] = base_model\n            else:\n                raise ValueError(\n                    f\"Unsupported input to ValidationNode. Expected BaseModel, tool or function. Got: {type(schema)}.\"\n                )\n\n    def _get_message(\n        self, input: list[AnyMessage] | dict[str, Any]","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/prebuilt/langgraph/prebuilt/tool_validator.py#L133-L169","documentation":"Error \"Validation node only works with tools that have a pydantic BaseModel args_schema. Got {schema.name} with args_schema: {schema.args_schema}.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/prebuilt/langgraph/prebuilt/tool_validator.py:151 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"}