feat: refresh cached MCP tool schema before call#915
Open
radugheo wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances MCP cached discovery mode by optionally refreshing the live tool schema from the server immediately before each tool invocation, improving resilience when server-side tool contracts change while still planning from the cached snapshot.
Changes:
- Added per-call schema refresh for cached discovery mode via a
refresh_schema_before_callflag (defaulting to enabled in cached mode) with best-effort fallback behavior. - Extended MCP tool creation/invocation tests to cover refresh ordering, disabling the refresh, and graceful fallback scenarios.
- Bumped package version to
0.12.1and updated module/test documentation accordingly.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/uipath_langchain/agent/tools/mcp/mcp_tool.py |
Implements cached-mode per-call list_tools() refresh logic and defensive flag reading for backward compatibility. |
tests/agent/tools/test_mcp/test_mcp_tool.py |
Adds focused async tests validating refresh behavior, ordering, and fallback paths. |
src/uipath_langchain/agent/tools/mcp/claude.md |
Documents cached mode behavior, defaults, and the rationale for per-call refresh. |
tests/agent/tools/test_mcp/claude.md |
Updates test module documentation to include the new test class and coverage summary. |
pyproject.toml |
Version bump to 0.12.1. |
uv.lock |
Lockfile updated to reflect the new package version. |
9a077ed to
818c51c
Compare
818c51c to
f128a55
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



refresh_schema_before_callis enabled (default true); when disabled, the cached snapshot is used as-is.Tested live (DeepWiki MCP) across all discovery modes:
Related PRs:
Development Package
uipath pack --nolockto get the latest dev build from this PR (requires version range).