Skip to content

Fix MCP callback binding for parameter aliases - #3279

Open
hutiefang76 wants to merge 1 commit into
alibaba:masterfrom
hutiefang76:frank/thirty-arthas-mcp-audit-20261020
Open

hutiefang76 wants to merge 1 commit into
alibaba:masterfrom
hutiefang76:frank/thirty-arthas-mcp-audit-20261020

Conversation

@hutiefang76

Copy link
Copy Markdown

Fixes #3278.

The public callback API can advertise a parameter as message_text through @JsonProperty, then reject {"message_text":"hello"} because validation and binding still look up the Java name message. Optional aliased arguments are silently passed as null.

Reuse the schema generator's existing parameter-name resolver for both required checks and argument binding. Missing-argument errors now report the advertised name too. Unannotated parameters, empty aliases and ToolContext injection keep their existing behavior.

This concerns callbacks constructed with ToolDefinitions.from(Method) and DefaultToolCallback.builder(). The built-in agent tools do not declare parameter aliases; this does not change their configuration or fix unrelated tt/trace issues. The README includes a public API example and Chinese/English guidance.

Validation on JDK 8:

  • The seven new public-API regression cases reproduce four failures on the unchanged source: two assertion failures and two missing-argument errors; three controls pass.
  • ./mvnw -B -pl arthas-mcp-server -am clean verify: all 20 tests pass, including the seven new cases; no failures, errors or skips.
  • git diff --check passes.

Use the same parameter name resolution for the advertised input schema, required argument checks and reflective invocation. Otherwise valid JSON using a JsonProperty alias is rejected or bound as null.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T18:38:36.198247Z 3ca763c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP callback parameter aliases differ between generated schema and argument binding

1 participant