feat(agentgateway): enhance credential detection logic for service bi…#170
feat(agentgateway): enhance credential detection logic for service bi…#170KoblerS wants to merge 11 commits into
Conversation
…nding and defaults
…ice bindings by type
- Introduced a new module `_mcp_session.py` to encapsulate MCP session management logic. - Added `invoke_mcp_tool` function to handle tool invocation with improved error handling. - Updated test cases in `test_lob.py` to reflect changes in error messages and patching for MCP session. - Updated package version to 0.26.1 in `uv.lock`.
…umentation - Added `_resolve_dependency` function to resolve integration dependencies by ORD ID. - Updated `get_mcp_tools_customer` and `list_mcp_tools` to support filtering by ORD ID. - Refactored `call_mcp_tool` to handle tool name resolution with optional ORD ID. - Enhanced user guide with detailed credential detection and usage examples. - Added unit tests for new functionality and edge cases related to ORD ID resolution.
|
Please fulfill PR template to facilitate review |
|
Please resolve conflicts |
…gent-card changes - Resolved conflicts in _lob.py, agw_client.py, user-guide.md - Replaced invoke_mcp_tool with call_mcp_tool_customer/call_mcp_tool_lob - Added call_mcp_tool_customer to _customer.py (from upstream extensibility PR) - Preserved resolve_base_mount reuse in detect_customer_agent_credentials
- Remove _SERVICE_BINDING_ROOT_ENV from _customer.py (replaced by resolve_base_mount); update test_customer.py to use string literal - Apply ruff formatting to _customer.py, _mcp_session.py, agw_client.py - Bump version 0.31.0 → 0.32.0 (src/ modified)
- Add ord_id=None to get_mcp_tools_customer assertions - Update IAS fragment error message regexes to match new specific messages - Redirect call_mcp_tool_lob mock patches from _mcp_session to _lob
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| async def invoke_mcp_tool( |
There was a problem hiding this comment.
How s this different from run_mcp_tool?
There was a problem hiding this comment.
could you point me to run_mcp_tool please, not sure where this comes?
There was a problem hiding this comment.
sorry, it's call_mcp_tool: https://github.com/SAP/cloud-sdk-python/blob/main/src/sap_cloud_sdk/agentgateway/agw_client.py
| # Filter to a specific ORD ID — tenant ID is derived from credentials automatically | ||
| tools = await agw_client.list_mcp_tools( | ||
| user_token="user-jwt", | ||
| ord_id="sap.s4:apiResource:API_PRODUCT_0002_MCP:v1", |
There was a problem hiding this comment.
Isn't the ord id declared on asset.yaml? Has this definition changed?
There was a problem hiding this comment.
yes but the agent still needs to specify what to call in the MCP call case so in which skill context etc
There was a problem hiding this comment.
The filter use case is still pending discussion and it was not aligned with us. We should have consistency for LoB and Customer Agents.
There was a problem hiding this comment.
Could you please follow up with Felipe on this he is aware of it
@KoblerS Can you please provider explanation for these changes? Thank you |
…nding and defaults
Description
Provide a clear description of your changes here.
Related Issue
Closes #<issue_number>
(Link to the GitHub issue this PR addresses)
Type of Change
Please check the relevant option:
How to Test
Describe how reviewers can test your changes:
Checklist
Before submitting your PR, please review and check the following:
Breaking Changes
If this PR introduces breaking changes, please describe:
Additional Notes
Add any additional context, screenshots, or information that would help reviewers.