From 50cae44dd015f676178dd224d426fc81af74899d Mon Sep 17 00:00:00 2001 From: Omar Abdelwahab Date: Thu, 13 Nov 2025 17:39:55 -0800 Subject: [PATCH] fix: Update MCP test to use register() instead of register_tool_group() The Stainless-generated SDK now uses register() and unregister() methods instead of register_tool_group() and unregister_toolgroup(). Updated the test to use the correct method names that match the latest SDK. --- tests/integration/inference/test_tools_with_schemas.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/integration/inference/test_tools_with_schemas.py b/tests/integration/inference/test_tools_with_schemas.py index 6a9882a15..5b6e69ae3 100644 --- a/tests/integration/inference/test_tools_with_schemas.py +++ b/tests/integration/inference/test_tools_with_schemas.py @@ -179,19 +179,15 @@ class TestMCPToolsInChatCompletion: if not isinstance(llama_stack_client, LlamaStackAsLibraryClient): pytest.skip("Library client required for local MCP server") - # Check if the client has the register_tool_group method (older client versions) - if not hasattr(llama_stack_client.toolgroups, 'register_tool_group'): - pytest.skip("Client SDK doesn't support dynamic toolgroup registration - toolgroups must be configured in run.yaml") - test_toolgroup_id = "mcp::calc" uri = mcp_with_schemas["server_url"] try: - llama_stack_client.toolgroups.unregister_toolgroup(toolgroup_id=test_toolgroup_id) + llama_stack_client.toolgroups.unregister(toolgroup_id=test_toolgroup_id) except Exception: pass - llama_stack_client.toolgroups.register_tool_group( + llama_stack_client.toolgroups.register( toolgroup_id=test_toolgroup_id, provider_id="model-context-protocol", mcp_endpoint=dict(uri=uri),