Skip to content

feat(java): adopt SDK-native tool-input validation (opt-in strictness) #1303

Description

@dhyansraj

Context

The MCP Java SDK 2.0 upgrade (see the SDK-bump issue) enables tools/call input validation by default — strict JSON-Schema 2020-12 type checking that runs before the tool handler. For the 2.0 bump we set .validateToolInputs(false) to hold behavior constant: mesh keeps its lenient cross-runtime coercion (e.g. a caller sending "5" for an integer @Param is coerced, not rejected) and its soft-fail / strictness-opt-in design philosophy, and validation does not preempt mesh's dependency-unavailable / superseded / settle-grace logic.

Ask

Evaluate adopting SDK-native input validation deliberately:

  • Confirm mesh's generated input schemas (incl. victools-generated nested schemas) don't emit additionalProperties:false that would reject legitimate mesh-shaped payloads (injected params, trace fields).
  • Decide the interaction with mesh's existing lenient coercion — validate-then-coerce vs coerce-then-validate, and whether strictness should be opt-in per-tool or global.
  • Ensure early rejection composes correctly with dependency-unavailable / superseded / settle-grace ordering.
  • Cross-runtime regression pass (loosely-typed Python/TS callers) before flipping the default.

Deferred deliberately; not blocking the 2.0 bump.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions