Repository navigation
fix(redis): accept explicit null for optional tool arguments - #444
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
|
Start review |
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
Closes #440. The Redis MCP tool signatures used non-nullable annotations with
Nonedefaults, so the MCP SDK generated schemas that rejected explicit JSONnullbefore the handler could apply its existing optional-argument behavior. This updates the 102 optional parameters across 26 Redis tools to nullable annotations while preserving their defaults and request handling.Adds an offline regression test that validates all registered Redis tool argument models with their default-
Noneparameters explicitly set to null. It makes no Redis/Volcengine API calls.Validation
python -m unittest discover -s server/mcp_server_redis/tests— 8 tests passed on Python 3.13 usingmcp[cli]==1.12.4,pydantic==2.10.6, andvolcengine-python-sdk==4.0.24.python -m compileall -qfor the Redis package source and new test — passed.Nonefields across 26 tools accept explicit null.describe_regionsnow advertises string-or-null and validates{"region_id": null}.git diff --check— passed.The package's existing
uv.lockis out of sync withpyproject.toml, so the test run used an isolated no-project environment with the declared compatible dependency versions; no lockfile update is included. No live service calls, credentials, or customer data were used.