Skip to content

fix(redis): accept explicit null for optional tool arguments - #444

Open
dajiaohuang wants to merge 1 commit into
volcengine:mainfrom
dajiaohuang:fix/redis-optional-null-440
Open

dajiaohuang wants to merge 1 commit into
volcengine:mainfrom
dajiaohuang:fix/redis-optional-null-440

Conversation

@dajiaohuang

Copy link
Copy Markdown

Summary

Closes #440. The Redis MCP tool signatures used non-nullable annotations with None defaults, so the MCP SDK generated schemas that rejected explicit JSON null before 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-None parameters 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 using mcp[cli]==1.12.4, pydantic==2.10.6, and volcengine-python-sdk==4.0.24.
  • python -m compileall -q for the Redis package source and new test — passed.
  • Exercised all 41 registered tool schemas; all 102 default-None fields across 26 tools accept explicit null. describe_regions now advertises string-or-null and validates {"region_id": null}.
  • git diff --check — passed.

The package's existing uv.lock is out of sync with pyproject.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.

@github-actions

Copy link
Copy Markdown

Start review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp_server_redis: optional tool arguments reject explicit null (102 args on 26 tools)

1 participant