Repository navigation
fix: let optional params accept an explicit null - #75
Merged
adarshdigievo merged 2 commits intoOct 27, 2026
Merged
Conversation
Contributor
Author
|
Hi @adarshdigievo, just checking this one is still on your radar. It's still mergeable, and the new test fails on both tools without the fix and passes with it. Happy to change anything. |
adarshdigievo
self-requested a review
October 27, 2026 09:38
Member
|
Thanks for the fix, @vishalhabib99! I reproduced this with CrewAI’s URL-based HTTP MCP integration. It sends Merging now. The fix will be included in the next release. |
adarshdigievo
approved these changes
Oct 27, 2026
Contributor
Author
|
Thanks @adarshdigievo, and for confirming it with CrewAI's HTTP integration. Good to know which client was sending the null in practice. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Annotate
paramson thesearch_tableandsearch_dashboardMCP App tools asdict[str, Any] | None = None(it wasdict[str, Any] = None), matching thesearchtool.Why
The generated input schema advertises
"default": nullon a field whose type (object) rejects null. Some agent frameworks fill every optional argument with its advertised default, so they send"params": nulland the call fails validation before the tool runs. The function body already handlesNone(fetch_search_datausesparams or {}), so only the annotation was wrong.Testing
test_app_tools_accept_explicit_null_params(parametrized over both tools): it checks that the schema allows null and that calling with{"params": null}through a FastMCPClientsucceeds. It fails on both tools without the fix and passes with it.uv run pytest -q: 241 passed, 1 skipped (live contract test, needsSERPAPI_KEY).uv format --check: clean.Reproduction
In-memory FastMCP client,
serpapi.searchstubbed (no network):Before:
(same for
search_dashboard)After:
Additional Notes
Found with mcp-doctor's
none_default_typecheck, then reproduced as above. If useful, it can scan the rest of the server with no install: open a scan request.