Skip to content

Conversation

@balazsthomay
Copy link
Contributor

Resolves (#1739)

Problem
MCP tools failed validation when used with remote executors (e2b, modal, docker).

  • MCP tools (from mcpadapt) have required __init__ params without defaults
  • validate_tool_attributes() enforced default values for all params
  • Remote executors call get_tools_definition_code() which triggers validation

Solution
Added check_init_defaults parameter to validate_tool_attributes():

  • Default True (backwards compatible)
  • Pass False from get_tools_definition_code() for pre-instantiated tools
  • Skip __init__ default checks + method validation when disabled

Changes

  • tool_validation.py: Add check_init_defaults param, wrap validation conditionally
  • tools.py: Pass check_init_defaults=False in get_tools_definition_code()

Reproduced script now runs without errors.

Copy link
Collaborator

@aymeric-roucher aymeric-roucher left a comment

Choose a reason for hiding this comment

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

Thank you!

@aymeric-roucher
Copy link
Collaborator

Any way to add tests for this PR in tests/test_remote_executors.py?

@balazsthomay
Copy link
Contributor Author

Any way to add tests for this PR in tests/test_remote_executors.py?

Ofc, just did!

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.

2 participants