Skip to content

Commit b5eeb7e

Browse files
Copilotpontemonti
andcommitted
Add server_name fallback logic in OpenAI MCP tool registration service
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
1 parent 1cf6acc commit b5eeb7e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ 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 mcp_server_name if available (not None or empty), otherwise fall back to mcp_server_unique_name
105+
server_name = server_config.mcp_server_name or server_config.mcp_server_unique_name
104106
# Use the URL from config (always populated by the configuration service)
105107
server_url = server_config.url
106108
server_info = MCPServerInfo(
107-
name=server_config.mcp_server_name,
109+
name=server_name,
108110
url=server_url,
109111
)
110112
mcp_servers_info.append(server_info)

0 commit comments

Comments
 (0)