Skip to content

Fix explicit null validation for optional MCP tool inputs - #474

Open
dustin-sale wants to merge 3 commits into
oracle:mainfrom
dustin-sale:codex/470-nullable-tool-inputs
Open

dustin-sale wants to merge 3 commits into
oracle:mainfrom
dustin-sale:codex/470-nullable-tool-inputs

Conversation

@dustin-sale

@dustin-sale dustin-sale commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Optional tool arguments annotated with non-nullable types reject explicit
JSON null even when their default is None. For example, Database calls
with "region": null fail validation instead of using the configured
default region.

Update 302 optional parameters across six servers to accept null,
preserving existing defaults, handler behavior, and validation constraints:

  • OCI Database: 143 region parameters.
  • Oracle Data Studio: 148 string/integer parameters across 44 tools.
  • OCI Networking: four VCN/VLAN filters across three tools.
  • OCI Cloud Guard: the optional update_problem_status comment.
  • MySQL: SQL parameters and two Object Storage compartment filters.
  • DBTools: report description, bind parameters, and bind values.

Add regression tests for advertised schemas and tool calls with omitted,
null, valid, and invalid inputs. Update existing server changelogs.

No dependencies change. Data Studio's coverage improvements and 90%
coverage gate already on main are preserved without modification.

Fixes #470

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Null-input regression tests failed before the annotation fixes and passed
afterward. External OCI and database operations are mocked.

With the project toolchain and package dependencies installed:

  • moon run :test — passed; 31 tasks completed.
    Data Studio: 764 tests passed with 90.15% coverage.
  • moon run root:combine-coverage --force — passed with 94%
    combined Python coverage.
  • moon run root:lint --force — passed.
  • From src/mysql-mcp-server:
    python -m unittest oracle.mysql_mcp_server.tests.test_null_inputs -v
    — two tests passed, including three parameter subtests.
  • From src/dbtools-mcp-server:
    python -m unittest test_null_inputs -v
    — two tests passed, including three parameter subtests.

Validation limits: the full MySQL suite has nine failures and 24 setup
errors under the offline configuration; the same failing/error test IDs
occur on unchanged baseline code. DBTools' existing live-service suite
was not run. These two packages are excluded from the Moon workspace.

Test Configuration:

  • Firmware version: Not applicable.
  • Hardware: Not applicable; null-input regression tests mock external services.
  • Toolchain: Python 3.13.15, Moon, uv, and unittest.
  • SDK: FastMCP 3.4.5; OCI Python SDK 2.185.1 in the Database test environment.
    Other packages use their existing dependency definitions.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Accept explicit null for 154 optional tool parameters in Database, Networking, Cloud Guard, MySQL, and DBTools. Add schema and dispatch regression tests and update existing server changelogs.

Refs oracle#470

Signed-off-by: Dustin Sale <dustin.sale@oracle.com>
Accept explicit null for 148 optional tool parameters across ADP, Essbase, and Data Transforms. Add focused schema and dispatch regression tests, preserving the coverage gate and coverage tests already on main.

Refs oracle#470

Signed-off-by: Dustin Sale <dustin.sale@oracle.com>
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 7, 2026
@dustin-sale
dustin-sale marked this pull request as ready for review October 7, 2026 16:20

This branch has not been deployed

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

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oci-database-mcp-server: explicit null for optional region fails validation on 143 tools

1 participant