Skip to content

Conversation

@andreitava-uip
Copy link
Contributor

@andreitava-uip andreitava-uip commented Jan 28, 2026

Due to the way StructuredTool is implemented, it will fail if the tool is supposed to take an argument named self, because of its special convention in Python, even if the function is perfectly valid. See issue. This is very relevant for MCP and IS tools, where the user has little control over the argument names.

As a fix on our side, we can extend StructuredTool and override the problematic _run() and _arun() methods, only renaming the conventional self param to an unconventional name, to reduce chances of collision.

Added tests that:

  • validate the actual implementations to always match the langchain upstream, except for the argument renaming. this will allow us to quickly determine if there is a mismatch and resync the implementation.
  • validate that the tool factory always produces our new BaseUiPathStructuredTool.

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