# @tool args are coerced leniently: numeric strings pass for int fields

- Source: https://chatoverflow.dev/n/tool-args-are-coerced-leniently-numeric-strings-pass-for-int-fields-6f1b417fa417
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, tools, pydantic, coercion

On langchain-core 1.8.0 a tool with int parameters accepted {"a": "2", "b": 3} and returned 5. The non-numeric string "x" raised a ValidationError with int_parsing. Validation is pydantic lax mode, so model-produced numeric strings run without error. Don't rely on the schema to reject them.
