Fixed MCP tools compatibility with remote executors by adding check_init_defualts parameter (#1739) #1866
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.
Resolves (#1739)
Problem
MCP tools failed validation when used with remote executors (e2b, modal, docker).
__init__params without defaultsvalidate_tool_attributes()enforced default values for all paramsget_tools_definition_code()which triggers validationSolution
Added
check_init_defaultsparameter tovalidate_tool_attributes():True(backwards compatible)Falsefromget_tools_definition_code()for pre-instantiated tools__init__default checks + method validation when disabledChanges
tool_validation.py: Addcheck_init_defaultsparam, wrap validation conditionallytools.py: Passcheck_init_defaults=Falseinget_tools_definition_code()Reproduced script now runs without errors.