Skip to content

Conversation

Chaitanya-Keyal
Copy link

Fixes: #263

Summary

This PR enhances the load_mcp_tools function to accept two new optional parameters:

  • handle_tool_error
  • handle_validation_error

These parameters are forwarded to the StructuredTool constructor for each tool, allowing users to customize how errors and validation issues are handled.

Changes Made

  • Updated the load_mcp_tools signature to accept handle_tool_error and handle_validation_error.
  • Passed these parameters when instantiating each StructuredTool.

Example Usage

tools = load_mcp_tools(
    ...,
    handle_tool_error=custom_tool_error_handler,
    handle_validation_error=custom_validation_handler
)

This change is fully backward-compatible and does not affect existing behavior if the new parameters are not provided.

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.

[Feature Request] Support handle_tool_error and handle_validation_error in load_mcp_tools
1 participant