Skip to content

Commit c4d0d3b

Browse files
committed
Rename agent_instance_id to agentic_app_id throughout codebase
1 parent 088eca3 commit c4d0d3b

10 files changed

Lines changed: 46 additions & 52 deletions

File tree

libraries/microsoft-agents-a365-tooling-extensions-agentframework/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def main():
8282
chat_client=chat_client,
8383
agent_instructions="You are a helpful assistant that can provide weather and restaurant information.",
8484
initial_tools=[], # Your existing tools
85-
agent_instance_id="user-123",
85+
agentic_app_id="user-123",
8686
environment_id="prod",
8787
auth_token="your-auth-token"
8888
)
@@ -139,7 +139,7 @@ async def main():
139139
loaded from configured servers. Use these tools to enhance your capabilities.
140140
""",
141141
initial_tools=existing_tools,
142-
agent_instance_id="user-123",
142+
agentic_app_id="user-123",
143143
environment_id="production",
144144
auth_token="your-auth-token"
145145
)
@@ -190,7 +190,7 @@ agent = await service.add_tool_servers_to_agent(
190190
chat_client=chat_client,
191191
agent_instructions="You are a helpful assistant with access to various tools.",
192192
initial_tools=[], # Your existing tools
193-
agent_instance_id="user-123",
193+
agentic_app_id="user-123",
194194
environment_id="prod",
195195
auth_token="your-token"
196196
)

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def add_tool_servers_to_agent(
4141
chat_client: Union[OpenAIChatClient, AzureOpenAIChatClient],
4242
agent_instructions: str,
4343
initial_tools: List[Any],
44-
agent_instance_id: str,
44+
agentic_app_id: str,
4545
environment_id: str,
4646
auth: Optional[Authorization] = None,
4747
auth_token: Optional[str] = None,
@@ -54,7 +54,7 @@ async def add_tool_servers_to_agent(
5454
chat_client: The chat client instance (Union[OpenAIChatClient, AzureOpenAIChatClient])
5555
agent_instructions: Instructions for the agent behavior
5656
initial_tools: List of initial tools to add to the agent
57-
agent_instance_id: Unique identifier for the agent instance
57+
agentic_app_id: Agentic app identifier for the agent
5858
environment_id: Environment identifier for MCP server discovery
5959
auth: Optional authorization context
6060
auth_token: Optional bearer token for authentication
@@ -65,18 +65,12 @@ async def add_tool_servers_to_agent(
6565
"""
6666
try:
6767
self._logger.info(
68-
f"Listing MCP tool servers for agent {agent_instance_id} in environment {environment_id}"
68+
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
6969
)
7070

71-
agentic_app_id = agent_instance_id
72-
if turn_context and turn_context.activity and turn_context.activity.recipient:
73-
agentic_app_id = getattr(
74-
turn_context.activity.recipient, "agentic_app_id", agent_instance_id
75-
)
76-
7771
# Get MCP server configurations
7872
server_configs = await self._mcp_server_configuration_service.list_tool_servers(
79-
agent_instance_id=agentic_app_id,
73+
agentic_app_id=agentic_app_id,
8074
environment_id=environment_id,
8175
auth_token=auth_token,
8276
)

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(
7272
async def add_tool_servers_to_agent(
7373
self,
7474
project_client: "AIProjectClient",
75-
agent_instance_id: str,
75+
agentic_app_id: str,
7676
environment_id: str,
7777
auth: Authorization,
7878
context: TurnContext,
@@ -83,7 +83,7 @@ async def add_tool_servers_to_agent(
8383
8484
Args:
8585
project_client: The Azure Foundry AIProjectClient instance.
86-
agent_instance_id: Agent Instance ID for the agent.
86+
agentic_app_id: Agentic App ID for the agent.
8787
environment_id: Environment ID for the environment.
8888
auth_token: Authentication token to access the MCP servers.
8989
@@ -102,12 +102,12 @@ async def add_tool_servers_to_agent(
102102
try:
103103
# Get the tool definitions and resources using the async implementation
104104
tool_definitions, tool_resources = await self._get_mcp_tool_definitions_and_resources(
105-
agent_instance_id, environment_id, auth_token or ""
105+
agentic_app_id, environment_id, auth_token or ""
106106
)
107107

108108
# Update the agent with the tools
109109
project_client.agents.update_agent(
110-
agent_instance_id, tools=tool_definitions, tool_resources=tool_resources
110+
agentic_app_id, tools=tool_definitions, tool_resources=tool_resources
111111
)
112112

113113
self._logger.info(
@@ -116,20 +116,20 @@ async def add_tool_servers_to_agent(
116116

117117
except Exception as ex:
118118
self._logger.error(
119-
f"Unhandled failure during MCP tool registration workflow for agent user {agent_instance_id}: {ex}"
119+
f"Unhandled failure during MCP tool registration workflow for agent user {agentic_app_id}: {ex}"
120120
)
121121
raise
122122

123123
async def _get_mcp_tool_definitions_and_resources(
124-
self, agent_instance_id: str, environment_id: str, auth_token: str
124+
self, agentic_app_id: str, environment_id: str, auth_token: str
125125
) -> Tuple[List[McpTool], Optional[ToolResources]]:
126126
"""
127127
Internal method to get MCP tool definitions and resources.
128128
129129
This implements the core logic equivalent to the C# method of the same name.
130130
131131
Args:
132-
agent_instance_id: Agent Instance ID for the agent.
132+
agentic_app_id: Agentic App ID for the agent.
133133
environment_id: Environment ID for the environment.
134134
auth_token: Authentication token to access the MCP servers.
135135
@@ -143,17 +143,17 @@ async def _get_mcp_tool_definitions_and_resources(
143143
# Get MCP server configurations
144144
try:
145145
servers = await self._mcp_server_configuration_service.list_tool_servers(
146-
agent_instance_id, environment_id, auth_token
146+
agentic_app_id, environment_id, auth_token
147147
)
148148
except Exception as ex:
149149
self._logger.error(
150-
f"Failed to list MCP tool servers for AgentInstanceId={agent_instance_id}: {ex}"
150+
f"Failed to list MCP tool servers for AgenticAppId={agentic_app_id}: {ex}"
151151
)
152152
return ([], None)
153153

154154
if len(servers) == 0:
155155
self._logger.info(
156-
f"No MCP servers configured for AgentInstanceId={agent_instance_id}, EnvironmentId={environment_id}"
156+
f"No MCP servers configured for AgenticAppId={agentic_app_id}, EnvironmentId={environment_id}"
157157
)
158158
return ([], None)
159159

libraries/microsoft-agents-a365-tooling-extensions-openai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ registration_service = McpToolRegistrationService()
5353
# Add MCP tool servers to your OpenAI agent
5454
await registration_service.add_tool_servers_to_agent(
5555
agent=your_openai_agent,
56-
agent_instance_id="user-123",
56+
agentic_app_id="user-123",
5757
environment_id="prod",
5858
auth=authorization_context,
5959
context=turn_context,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self, logger: Optional[logging.Logger] = None):
5151
async def add_tool_servers_to_agent(
5252
self,
5353
agent: Agent,
54-
agent_instance_id: str,
54+
agentic_app_id: str,
5555
environment_id: str,
5656
auth: Authorization,
5757
context: TurnContext,
@@ -66,7 +66,7 @@ async def add_tool_servers_to_agent(
6666
6767
Args:
6868
agent: The existing agent to add servers to
69-
agent_instance_id: Agent Instance ID for the agent
69+
agentic_app_id: Agentic App ID for the agent
7070
environment_id: Environment ID for the environment
7171
auth_token: Authentication token to access the MCP servers
7272
@@ -83,10 +83,10 @@ async def add_tool_servers_to_agent(
8383
# mcp_server_configs = []
8484
# TODO: radevika: Update once the common project is merged.
8585
self._logger.info(
86-
f"Listing MCP tool servers for agent {agent_instance_id} in environment {environment_id}"
86+
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
8787
)
8888
mcp_server_configs = await self.config_service.list_tool_servers(
89-
agent_instance_id=agent_instance_id,
89+
agentic_app_id=agentic_app_id,
9090
environment_id=environment_id,
9191
auth_token=auth_token,
9292
)

libraries/microsoft-agents-a365-tooling-extensions-semantickernel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ registration_service = McpToolRegistrationService()
5555
# Add MCP tool servers to your Semantic Kernel
5656
await registration_service.add_tool_servers_to_kernel(
5757
kernel=kernel,
58-
agent_instance_id="user-123",
58+
agentic_app_id="user-123",
5959
environment_id="prod",
6060
auth_token="your-auth-token"
6161
)

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(
8484
async def add_tool_servers_to_agent(
8585
self,
8686
kernel: sk.Kernel,
87-
agent_instance_id: str,
87+
agentic_app_id: str,
8888
environment_id: str,
8989
auth: Authorization,
9090
context: TurnContext,
@@ -95,7 +95,7 @@ async def add_tool_servers_to_agent(
9595
9696
Args:
9797
kernel: The Semantic Kernel instance to which the tools will be added.
98-
agent_instance_id: Agent Instance ID for the agent.
98+
agentic_app_id: Agentic App ID for the agent.
9999
environment_id: Environment ID for the environment.
100100
auth_token: Authentication token to access the MCP servers.
101101
@@ -109,11 +109,11 @@ async def add_tool_servers_to_agent(
109109
authToken = await auth.exchange_token(context, scopes, "AGENTIC")
110110
auth_token = authToken.token
111111

112-
self._validate_inputs(kernel, agent_instance_id, environment_id, auth_token)
112+
self._validate_inputs(kernel, agentic_app_id, environment_id, auth_token)
113113

114114
# Get and process servers
115115
servers = await self._mcp_server_configuration_service.list_tool_servers(
116-
agent_instance_id, environment_id, auth_token
116+
agentic_app_id, environment_id, auth_token
117117
)
118118
self._logger.info(f"🔧 Adding MCP tools from {len(servers)} servers")
119119

@@ -178,13 +178,13 @@ async def add_tool_servers_to_agent(
178178
# ============================================================================
179179

180180
def _validate_inputs(
181-
self, kernel: Any, agent_instance_id: str, environment_id: str, auth_token: str
181+
self, kernel: Any, agentic_app_id: str, environment_id: str, auth_token: str
182182
) -> None:
183183
"""Validate all required inputs."""
184184
if kernel is None:
185185
raise ValueError("kernel cannot be None")
186-
if not agent_instance_id or not agent_instance_id.strip():
187-
raise ValueError("agent_instance_id cannot be null or empty")
186+
if not agentic_app_id or not agentic_app_id.strip():
187+
raise ValueError("agentic_app_id cannot be null or empty")
188188
if not environment_id or not environment_id.strip():
189189
raise ValueError("environment_id cannot be null or empty")
190190
if not auth_token or not auth_token.strip():

libraries/microsoft-agents-a365-tooling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ mcp_config = MCPServerConfig(
5858
# Use configuration service to list available MCP servers
5959
config_service = McpToolServerConfigurationService()
6060
mcp_servers = await config_service.list_tool_servers(
61-
agent_instance_id="agent-123",
61+
agentic_app_id="agent-123",
6262
environment_id="prod",
6363
auth_token="your-auth-token"
6464
)

libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ def __init__(self, logger: Optional[logging.Logger] = None):
7070
# --------------------------------------------------------------------------
7171

7272
async def list_tool_servers(
73-
self, agent_instance_id: str, environment_id: str, auth_token: str
73+
self, agentic_app_id: str, environment_id: str, auth_token: str
7474
) -> List[MCPServerConfig]:
7575
"""
7676
Gets the list of MCP Servers that are configured for the agent.
7777
7878
Args:
79-
agent_instance_id: Agent Instance ID for the agent.
79+
agentic_app_id: Agentic App ID for the agent.
8080
environment_id: Environment ID for the environment.
8181
auth_token: Authentication token to access the MCP servers.
8282
@@ -88,18 +88,18 @@ async def list_tool_servers(
8888
Exception: If there's an error communicating with the tooling gateway.
8989
"""
9090
# Validate input parameters
91-
self._validate_input_parameters(agent_instance_id, environment_id, auth_token)
91+
self._validate_input_parameters(agentic_app_id, environment_id, auth_token)
9292

9393
self._logger.info(
94-
f"Listing MCP tool servers for agent {agent_instance_id} in environment {environment_id}"
94+
f"Listing MCP tool servers for agent {agentic_app_id} in environment {environment_id}"
9595
)
9696

9797
# Determine configuration source based on environment
9898
if self._is_development_scenario():
9999
return self._load_servers_from_manifest(environment_id)
100100
else:
101101
return await self._load_servers_from_gateway(
102-
agent_instance_id, environment_id, auth_token
102+
agentic_app_id, environment_id, auth_token
103103
)
104104

105105
# --------------------------------------------------------------------------
@@ -292,13 +292,13 @@ def _log_manifest_search_failure(self) -> None:
292292
# --------------------------------------------------------------------------
293293

294294
async def _load_servers_from_gateway(
295-
self, agent_instance_id: str, environment_id: str, auth_token: str
295+
self, agentic_app_id: str, environment_id: str, auth_token: str
296296
) -> List[MCPServerConfig]:
297297
"""
298298
Reads MCP server configurations from tooling gateway endpoint for production scenario.
299299
300300
Args:
301-
agent_instance_id: Agent Instance ID for the agent.
301+
agentic_app_id: Agentic App ID for the agent.
302302
environment_id: Environment ID for the environment.
303303
auth_token: Authentication token to access the tooling gateway.
304304
@@ -311,7 +311,7 @@ async def _load_servers_from_gateway(
311311
mcp_servers: List[MCPServerConfig] = []
312312

313313
try:
314-
config_endpoint = get_tooling_gateway_for_digital_worker(agent_instance_id)
314+
config_endpoint = get_tooling_gateway_for_digital_worker(agentic_app_id)
315315
headers = self._prepare_gateway_headers(auth_token, environment_id)
316316

317317
self._logger.info(f"Calling tooling gateway endpoint: {config_endpoint}")
@@ -447,21 +447,21 @@ def _parse_gateway_server_config(
447447
# --------------------------------------------------------------------------
448448

449449
def _validate_input_parameters(
450-
self, agent_instance_id: str, environment_id: str, auth_token: str
450+
self, agentic_app_id: str, environment_id: str, auth_token: str
451451
) -> None:
452452
"""
453453
Validates input parameters for the main API method.
454454
455455
Args:
456-
agent_instance_id: Agent Instance ID to validate.
456+
agentic_app_id: Agentic App ID to validate.
457457
environment_id: Environment ID to validate.
458458
auth_token: Authentication token to validate.
459459
460460
Raises:
461461
ValueError: If any parameter is invalid or empty.
462462
"""
463-
if not agent_instance_id:
464-
raise ValueError("agent_instance_id cannot be empty or None")
463+
if not agentic_app_id:
464+
raise ValueError("agentic_app_id cannot be empty or None")
465465
if not environment_id:
466466
raise ValueError("environment_id cannot be empty or None")
467467
if not auth_token:

libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/utils/utility.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ class ToolsMode(Enum):
2222
PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE = "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default"
2323

2424

25-
def get_tooling_gateway_for_digital_worker(agent_instance_id: str) -> str:
25+
def get_tooling_gateway_for_digital_worker(agentic_app_id: str) -> str:
2626
"""
2727
Gets the tooling gateway URL for the specified digital worker.
2828
2929
Args:
30-
agent_instance_id: The unique identifier of the digital worker.
30+
agentic_app_id: The agentic app identifier of the digital worker.
3131
3232
Returns:
3333
str: The tooling gateway URL for the digital worker.
3434
"""
3535
# The endpoint needs to be updated based on the environment (prod, dev, etc.)
36-
return f"{_get_mcp_platform_base_url()}/agents/{agent_instance_id}/mcpServers"
36+
return f"{_get_mcp_platform_base_url()}/agents/{agentic_app_id}/mcpServers"
3737

3838

3939
def get_mcp_base_url() -> str:

0 commit comments

Comments
 (0)