Skip to content

Commit 6ce6e4f

Browse files
Copilotpontemonti
andcommitted
Remove fallback logic and use config.url directly in all tool registration services
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
1 parent cb3f7b8 commit 6ce6e4f

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

libraries/microsoft-agents-a365-tooling-extensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ async def add_tool_servers_to_agent(
9797
# Add servers as MCPStreamableHTTPTool instances
9898
for config in server_configs:
9999
try:
100-
# Use custom URL if provided, otherwise use the unique name
101-
server_url = config.url if config.url else config.mcp_server_unique_name
100+
# Use the URL from config (always populated by the configuration service)
101+
server_url = config.url
102102
if not server_url:
103103
self._logger.warning(f"MCP server config missing server_url: {config}")
104104
continue
@@ -114,7 +114,7 @@ async def add_tool_servers_to_agent(
114114
self._orchestrator_name
115115
)
116116

117-
server_name = config.mcp_server_name
117+
server_name = config.mcp_server_name if config.mcp_server_name else config.mcp_server_unique_name
118118

119119
# Create and configure MCPStreamableHTTPTool
120120
mcp_tools = MCPStreamableHTTPTool(

libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/microsoft_agents_a365/tooling/extensions/azureaifoundry/services/mcp_tool_registration_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ async def _get_mcp_tool_definitions_and_resources(
178178
else server.mcp_server_name
179179
)
180180

181-
# Use custom URL if provided, otherwise use the unique name
182-
server_url = server.url if server.url else server.mcp_server_unique_name
181+
# Use the URL from server (always populated by the configuration service)
182+
server_url = server.url
183183

184184
# Create MCP tool using Azure Foundry SDK
185185
mcp_tool = McpTool(server_label=server_label, server_url=server_url)

libraries/microsoft-agents-a365-tooling-extensions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ async def add_tool_servers_to_agent(
101101
# Convert MCP server configs to MCPServerInfo objects
102102
mcp_servers_info = []
103103
for server_config in mcp_server_configs:
104-
# Use custom URL if provided, otherwise use the unique name
105-
server_url = (
106-
server_config.url if server_config.url else server_config.mcp_server_unique_name
107-
)
104+
# Use the URL from config (always populated by the configuration service)
105+
server_url = server_config.url
108106
server_info = MCPServerInfo(
109107
name=server_config.mcp_server_name,
110108
url=server_url,

libraries/microsoft-agents-a365-tooling-extensions-semantickernel/microsoft_agents_a365/tooling/extensions/semantickernel/services/mcp_tool_registration_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ async def add_tool_servers_to_agent(
125125
self._orchestrator_name
126126
)
127127

128-
# Use custom URL if provided, otherwise use the unique name
129-
server_url = server.url if server.url else server.mcp_server_unique_name
128+
# Use the URL from server (always populated by the configuration service)
129+
server_url = server.url
130130

131131
plugin = MCPStreamableHttpPlugin(
132132
name=server.mcp_server_name,

0 commit comments

Comments
 (0)