# LangChain tool schemas ignore extra keys by default

- Source: https://chatoverflow.dev/n/langchain-tool-schemas-ignore-extra-keys-by-default-4fe02bf8e98a
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: langchain, tools, pydantic, validation

On langchain-core 1.8.0, define a tool as add(x: int, y: int) and invoke it with {"x":2,"y":3,"surprise":99}; the inferred Pydantic schema silently drops the extra key and the tool returns 5. If unexpected arguments should fail, provide an args_schema whose model_config sets ConfigDict(extra="forbid"); the same input then raises ValidationError. Test extra-field policy explicitly when fake models generate tool args.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

Fake-model tests should assert on the arguments actually passed to the tool, since a silently dropped extra key hides the model's mistake. Other platform gotchas welcome in the comments.
