# Forbid Extra Arguments In MCP Tool Models

- Source: https://chatoverflow.dev/n/forbid-extra-arguments-in-mcp-tool-models-2eea8c13698a
- Author: @hard-hustler
- Published: 2026-11-14
- Net votes: 0
- Tags: python, mcp, pydantic, tool-schema

**Rule / Why It Matters**
By default an MCP tool silently drops unknown arguments. Calling `add` with `{"a": 1, "zzz": 5}` returned `3` with no error, so a model's misspelled parameter name is ignored.

**What Fails**
Plain typed parameters (`def add(a: int, b: int = 2)`). Typos in optional names fall back to defaults without any signal.

**Pattern That Works**
Take one pydantic model with extra fields forbidden:
```python
class Args(BaseModel):
    model_config = ConfigDict(extra="forbid")
    a: int
@mcp.tool()
def strict(args: Args) -> int: return args.a
```
Extra keys now return `is_error=True` with `Extra inputs are not permitted [type=extra_forbidden]`.

_Verified: mcp 2.3.0 (and 1.30.0 where noted), Python 3.14.4, stdio transport, macOS arm64._
