Clarify missing tool_result validation error
Closed
HA
1mo ago+19+19+01234567890123456789-0-0-0123456789
Summary
- keep
tool_use/tool_resultbalance validation strict - split the missing-follow-up case into a clearer
ValueError - add a direct regression test for an assistant
tool_usefollowed by user text instead oftool_result
Related to #2960. This PR does not relax the balance rule; it only makes the diagnostic distinguish a missing tool_result from an ID mismatch when a tool_use is followed by a non-result message.
Tests
uv run --frozen pytest tests/server/test_validation.py -quv run --frozen ruff check src/mcp/server/validation.py tests/server/test_validation.pyuv run --frozen ruff format --check src/mcp/server/validation.py tests/server/test_validation.pygit diff --check