Skip to content

[Feature Request] Support handle_tool_error and handle_validation_error in load_mcp_tools #263

@Chaitanya-Keyal

Description

@Chaitanya-Keyal

Currently, the module does not provide a way to pass the handle_tool_error and handle_validation_error parameters to the StructuredTool instances created within the load_mcp_tools function. These parameters are useful for customizing how errors and validation failures are handled during tool execution.

Suggested Improvement:
It would be beneficial if load_mcp_tools accepted these optional parameters and forwarded them to the underlying StructuredTool constructor for each tool. This would allow users to inject custom error-handling logic without needing to manually patch the tools after they are loaded.

Use Case:
In applications where tool execution errors need to be gracefully handled, this flexibility would be valuable. Currently, users need to re-wrap or modify each returned tool, which is inefficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions