fix(runtime): preserve MCP tool inputSchema from SDK fields - #1101
Closed
AchuthReddy-16 wants to merge 1 commit into
Closed
fix(runtime): preserve MCP tool inputSchema from SDK fields#1101AchuthReddy-16 wants to merge 1 commit into
AchuthReddy-16 wants to merge 1 commit into
Conversation
Contributor
|
Thank you for the report and proposed work. This root cause is now covered by maintainer-owned stacked PR #1164, authored independently from We did not inspect or reuse this PR's diff, branch, commits, implementation code, or tests; its public description/comments were used only as a bug report. To keep one review surface, this PR is superseded by #1164 and is being closed. The complete review stack is #1158–#1165. It is being left unmerged for human review after CI and review-bot findings are cleared. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
McpIntegration.list_tools()always returned an emptyinputSchemafor MCP tools even when the server provided a schema.The MCP SDK exposes the field as
input_schemain Python, whileinputSchemais the JSON alias. The existing code only checkedinputSchema, so the lookup missed the actual SDK field and fell back to{}.This change reads
input_schemafirst while preservinginputSchemaas a fallback for compatible stubs. The fake MCP tool used in tests was also updated to match the real SDK shape, and a regression test verifies thatlist_tools()preserves the schema.Fixes #1073
Test plan
Ran:
PYTHONPATH=src python3 -m unittest discover -s test -p 'test_mcp_base.py' -vThe new
test_list_tools_keeps_input_schemacase passed along with the existing MCP tool-call coverage.Note
Fix
McpIntegrationtool discovery to preserveinput_schemafrom MCP SDKThe MCP SDK's
Tooltype uses the snake_case attributeinput_schema, but the cache population code in mcp_base.py only readinputSchema, causing schemas to be silently dropped to{}. The fix readsinput_schemafirst, falling back toinputSchema, then an empty dict, and stores the result underinputSchemain the internal cache.Macroscope summarized 5d88631.