Skip to content

Preserve additionalProperties in converted MCP tool schemas - #422

Closed
sylvesterkaczmarek wants to merge 1 commit into
anthropics:mainfrom
sylvesterkaczmarek:fix/mcp-additional-properties-policy-20261004
Closed

sylvesterkaczmarek wants to merge 1 commit into
anthropics:mainfrom
sylvesterkaczmarek:fix/mcp-additional-properties-policy-20261004

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #421.

Copy an explicitly supplied MCP JsonSchema.additionalProperties value into the Anthropic tool input schema. Preserve both false and true; leave an omitted value absent. Existing properties, required fields and both definition forms remain unchanged.

Validation

Four regression cases exercise public single-tool and list conversion APIs, serialized field presence and values, existing schema fields, definition retention and input nonmutation.

  • New tests against unchanged main: 3 failed, 1 passed.
  • Complete MCP module tests: 31 passed, zero skipped or failed.
  • MCP-module ktfmt, detektMain, detektTest and lintKotlin checks passed.
  • git diff --check passed.
./gradlew :anthropic-java-mcp:test :anthropic-java-mcp:detektMain :anthropic-java-mcp:detektTest :anthropic-java-mcp:lintKotlin --max-workers=1 --no-parallel

Tested on macOS arm64 with JDK 21 and pinned repository dependencies. The core SDK's complete suite, downstream ecosystem tests and live API validation were not run. No public signatures, dependencies or workflow changes.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team as a code owner October 4, 2026 22:55
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

All 31 MCP module tests pass locally, along with module formatting and detekt checks. Could a maintainer approve the pending CI workflow?

@tomer-ant

Copy link
Copy Markdown
Contributor

Closing along with #421. The reasoning is in #421 (comment).

@tomer-ant tomer-ant closed this Oct 14, 2026
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 tool conversion drops explicit additionalProperties restrictions

2 participants