Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ async def add_tool_servers_to_agent(
authToken = await auth.exchange_token(turn_context, scopes, "AGENTIC")
auth_token = authToken.token

self._logger.info(
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
)
if get_use_environment_id():
self._logger.info(
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
)
else:
self._logger.info(f"Listing MCP tool servers for agent {agentic_app_id}")

# Get MCP server configurations
server_configs = await self._mcp_server_configuration_service.list_tool_servers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ async def _get_mcp_tool_definitions_and_resources(
return ([], None)

if len(servers) == 0:
self._logger.info(
f"No MCP servers configured for AgenticAppId={agentic_app_id}, EnvironmentId={environment_id}"
)
if get_use_environment_id():
self._logger.info(
f"No MCP servers configured for AgenticAppId={agentic_app_id}, EnvironmentId={environment_id}"
)
else:
self._logger.info(f"No MCP servers configured for AgenticAppId={agentic_app_id}")
return ([], None)

# Collections to build for the return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ async def add_tool_servers_to_agent(
# Get MCP server configurations from the configuration service
# mcp_server_configs = []
# TODO: radevika: Update once the common project is merged.
self._logger.info(
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
)

if get_use_environment_id():
self._logger.info(
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
)
else:
self._logger.info(f"Listing MCP tool servers for agent {agentic_app_id}")
mcp_server_configs = await self.config_service.list_tool_servers(
agentic_app_id=agentic_app_id,
environment_id=environment_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _validate_inputs(
raise ValueError("kernel cannot be None")
if not agentic_app_id or not agentic_app_id.strip():
raise ValueError("agentic_app_id cannot be null or empty")
if not environment_id or not environment_id.strip():
if get_use_environment_id() and (not environment_id or not environment_id.strip()):
raise ValueError("environment_id cannot be null or empty")
if not auth_token or not auth_token.strip():
raise ValueError("auth_token cannot be null or empty")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ async def list_tool_servers(
# Validate input parameters
self._validate_input_parameters(agentic_app_id, environment_id, auth_token)

self._logger.info(
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
)
if get_use_environment_id():
self._logger.info(
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
)
else:
self._logger.info(f"Listing MCP tool servers for agent {agentic_app_id}")

# Determine configuration source based on environment
if self._is_development_scenario():
Expand Down Expand Up @@ -460,7 +463,7 @@ def _validate_input_parameters(
"""
if not agentic_app_id:
raise ValueError("agentic_app_id cannot be empty or None")
if not environment_id:
if get_use_environment_id() and not environment_id:
raise ValueError("environment_id cannot be empty or None")
if not auth_token:
raise ValueError("auth_token cannot be empty or None")
Expand Down
Loading