Skip to content

Commit 2f27e11

Browse files
fix the HR scenario issue by implementing the tools filtering and updated the azure.yaml
1 parent 805a51d commit 2f27e11

2 files changed

Lines changed: 54 additions & 13 deletions

File tree

azure.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
22
name: multi-agent-custom-automation-engine-solution-accelerator
3-
metadata:
4-
template: multi-agent-custom-automation-engine-solution-accelerator@1.0
3+
# metadata:
4+
# template: multi-agent-custom-automation-engine-solution-accelerator@1.0
55
requiredVersions:
66
azd: '>= 1.18.0 != 1.23.9'
77
hooks:
@@ -18,12 +18,12 @@ hooks:
1818
Write-Host ""
1919
2020
Write-Host " Build and push the backend/frontend/mcp_server container images to ACR, then point the container app and webapp at them:" -ForegroundColor White
21-
Write-Host " 👉 Run the following command in Bash:" -ForegroundColor White
21+
Write-Host " 👉 STEP 1: Run the following command in Bash:" -ForegroundColor White
2222
Write-Host " bash infra/scripts/post-provision/build_and_push_images.sh" -ForegroundColor Cyan
2323
Write-Host ""
2424
2525
Write-Host " Upload Team Configurations, index sample data and create the Knowledge base from content Packs" -ForegroundColor White
26-
Write-Host " 👉 Run the following command in Bash:" -ForegroundColor White
26+
Write-Host " 👉 STEP 2: Run the following command in Bash:" -ForegroundColor White
2727
Write-Host " bash infra/scripts/post-provision/post_deploy.sh" -ForegroundColor Cyan
2828
Write-Host ""
2929
@@ -39,12 +39,12 @@ hooks:
3939
Write-Host ""
4040
4141
Write-Host " Build and push the backend/frontend/mcp_server container images to ACR, then point the container app and webapp at them:" -ForegroundColor White
42-
Write-Host " 👉 Run the following command in PowerShell:" -ForegroundColor White
42+
Write-Host " 👉 STEP 1: Run the following command in PowerShell:" -ForegroundColor White
4343
Write-Host " .\infra\scripts\post-provision\Build-And-Push-Images.ps1" -ForegroundColor Cyan
4444
Write-Host ""
4545
4646
Write-Host " Upload Team Configurations, index sample data and create the Knowledge base from content Packs" -ForegroundColor White
47-
Write-Host " 👉 Run the following command in PowerShell:" -ForegroundColor White
47+
Write-Host " 👉 STEP 2: Run the following command in PowerShell:" -ForegroundColor White
4848
Write-Host " .\infra\scripts\post-provision\post_deploy.ps1" -ForegroundColor Cyan
4949
Write-Host ""
5050
@@ -69,11 +69,11 @@ hooks:
6969
printf "${Yellow}===============================================================${NC}\n\n"
7070
7171
printf "Build and push the backend/frontend/mcp_server container images to ACR, then point the container app and webapp at them:\n"
72-
printf " 👉 Run the following command in Bash:\n"
72+
printf " 👉 STEP 1: Run the following command in Bash:\n"
7373
printf " ${Blue}bash infra/scripts/post-provision/build_and_push_images.sh${NC}\n\n"
7474
7575
printf "Upload Team Configurations, index sample data and create the Knowledge base from content Packs:\n"
76-
printf " 👉 Run the following command in Bash:\n"
76+
printf " 👉 STEP 2: Run the following command in Bash:\n"
7777
printf " ${Blue}bash infra/scripts/post-provision/post_deploy.sh${NC}\n\n"
7878
7979
printf "🌐 Access your deployed Frontend application at:\n"

src/backend/config/mcp_config.py

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,34 @@
2020
# so the LLM only sees the relevant subset (avoids cross-pack tool confusion when
2121
# the MCP server exposes every function at the base /mcp endpoint).
2222
DOMAIN_ALLOWED_TOOLS: dict[str, list[str]] = {
23-
"image": ["generate_marketing_image"],
23+
"hr": [
24+
"get_workflow_blueprint",
25+
"schedule_orientation_session",
26+
"assign_mentor",
27+
"register_for_benefits",
28+
"provide_employee_handbook",
29+
"initiate_background_check",
30+
"request_id_card",
31+
"set_up_payroll",
32+
],
33+
"tech_support": [
34+
"get_workflow_blueprint",
35+
"send_welcome_email",
36+
"set_up_office_365_account",
37+
"configure_laptop",
38+
"setup_vpn_access",
39+
"create_system_accounts",
40+
],
41+
"marketing": [
42+
"generate_press_release",
43+
"handle_influencer_collaboration",
44+
],
45+
"product": [
46+
"get_product_info",
47+
],
48+
"image": [
49+
"generate_marketing_image",
50+
],
2451
}
2552

2653

@@ -55,10 +82,24 @@ def from_env(cls, domain: str | None = None) -> "MCPConfig":
5582
if not all([url, name, description, tenant_id, client_id]):
5683
raise ValueError(f"{cls.__name__}: missing required environment variables")
5784

58-
# NOTE: URL rewriting to /<domain>/mcp is disabled because the
59-
# currently-deployed MCP server only exposes the catch-all /mcp
60-
# endpoint. We rely on the client-side ``allowed_tools`` filter
61-
# below to scope the LLM's tool surface to the right domain.
85+
# Rewrite base URL to the domain-scoped endpoint so the agent
86+
# connects to e.g. ``http://host:9000/hr/mcp`` instead of the
87+
# catch-all ``/mcp``. The MCP server mounts per-domain FastMCP
88+
# sub-apps at ``/<domain>`` (see mcp_server.py), each serving
89+
# only that domain's tools plus shared services (ask_user).
90+
# The ``allowed_tools`` client-side filter below acts as a
91+
# redundant safety net in case the server layout changes.
92+
if domain:
93+
stripped = url.rstrip("/")
94+
if stripped.endswith("/mcp"):
95+
# Base URL includes the /mcp path (e.g. https://host/mcp)
96+
# → insert domain before /mcp: https://host/hr/mcp
97+
stripped = stripped[: -len("/mcp")]
98+
url = stripped + f"/{domain}/mcp"
99+
else:
100+
# Base URL has no /mcp suffix → append /{domain}
101+
url = stripped + f"/{domain}"
102+
62103
allowed_tools = DOMAIN_ALLOWED_TOOLS.get(domain) if domain else None
63104

64105
return cls(

0 commit comments

Comments
 (0)