Skip to content

[hotfix][mcp] Fix MCPTool Jackson deserialization by ignoring unknown properties#532

Open
avichaym wants to merge 1 commit intoapache:mainfrom
avichaym:fix/mcp-tool-deserialization
Open

[hotfix][mcp] Fix MCPTool Jackson deserialization by ignoring unknown properties#532
avichaym wants to merge 1 commit intoapache:mainfrom
avichaym:fix/mcp-tool-deserialization

Conversation

@avichaym
Copy link

What is the purpose of the change

MCPTool deserialization fails with UnrecognizedPropertyException when a default ObjectMapper encounters the name and description fields serialized from the parent Tool class. These fields are not declared in MCPTool's @JsonCreator constructor.

This breaks checkpoint/restore and any JSON round-trip of MCPTool.

Brief change log

  • Add @JsonIgnoreProperties(ignoreUnknown = true) to MCPTool
  • Add regression test testJsonDeserializationWithDefaultMapper that uses a default ObjectMapper (the existing testJsonSerialization masked the bug by disabling FAIL_ON_UNKNOWN_PROPERTIES globally)

Does this pull request potentially affect one of the following parts

  • Runtime: yes (checkpoint/restore of MCP tool state)
  • Integration: yes (MCP module)

Documentation

N/A — bug fix only

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

@github-actions github-actions bot added priority/major Default priority of the PR or issue. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. doc-not-needed Your PR changes do not impact docs labels Feb 10, 2026
@wenjin272
Copy link
Collaborator

Hi, @avichaym, thanks for your contribution, and introducing Amazon integrations to Flink-Agents. I'll strive to start the review before the Chinese Spring Festival holiday.

I notice there are some test failures because of code style check, you can format the code by mvn spotless:apply.

@avichaym avichaym force-pushed the fix/mcp-tool-deserialization branch from 69065f8 to 26f7b33 Compare February 13, 2026 22:24
@avichaym
Copy link
Author

thank you @wenjin272 ... i fixed the code-styling issues. Now the python related tests fails in all 3 PR's due to what seems to be a worker issue , not related to the code ->

The test_long_term_memory_async_execution_in_action test fails because the nomic-embed-text model download didn't complete in time. The CI log shows the pull was still at 35% (95/274 MB at 7.3 KB/s) when
the test started:

pulling 970aa74c0a90: 35% ▕██████ ▏ 95 MB/274 MB 7.3 KB/s 6h48m

The pull_model() helper in test_utils.py has a 120s timeout and silently and seems to swallow the timeout exception, so the test proceeds without the model and fails with model "nomic-embed-text" not found. This is
probably a runner network speed issue

Copy link
Collaborator

@yanand0909 yanand0909 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @avichaym, this looks good to me.

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

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments