Skip to content

Preserve MCP tool callback order - #7209

Open
Vamsi-2581 wants to merge 1 commit into
spring-projects:mainfrom
Vamsi-2581:codex/preserve-mcp-tool-order
Open

Vamsi-2581 wants to merge 1 commit into
spring-projects:mainfrom
Vamsi-2581:codex/preserve-mcp-tool-order

Conversation

@Vamsi-2581

Copy link
Copy Markdown

Fixes #7206

What changed

Use insertion-ordered maps when de-duplicating tool callbacks in the stateful and stateless MCP converters. The existing first-match behavior for duplicate names is preserved, and provider order is retained in sync and async paths.

Tests

Added four regression cases that provide 30 ordered callbacks and assert the resulting order for stateful/stateless sync and async converters. I have not run the build locally; GitHub CI will validate the change.

AI assistance

Prepared with OpenAI Codex and reviewed by the human submitter.

Use insertion-ordered maps while de-duplicating tool callbacks in both stateful and stateless MCP converters. Add sync and async regression tests for provider order.

Fixes spring-projects#7206

Signed-off-by: Vamsi-2581 <245859299+Vamsi-2581@users.noreply.github.com>
Assisted-by: OpenAI Codex
@Vamsi-2581
Vamsi-2581 force-pushed the codex/preserve-mcp-tool-order branch from 4310422 to 7182029 Compare October 21, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolCallbackProvider AutoConfiguration does not preserve tool order

2 participants