Your platform team runs the gateway, but the people who decide which tools agents may use sit in IT and security, and they work in the Microsoft 365 admin center, not in Azure. When a tool is found to be risky, they need to switch it off across every gateway in minutes, without filing a ticket. In this lab you connect Microsoft Agent 365 to your gateways, block one tool and then a whole MCP server from the admin center, and watch the gateway enforce each decision on live traffic.
Before you begin
One-time setupThe Setup guide tasks that this lab uses. Mark each one done once, and the labs stop listing it.
- Choose where to run commandsEvery track except the portal
- Sign in to AzureOn your own machine. Cloud Shell is already signed in.
- Install the
aigatewayextensionThe Azure CLI tracks and the Verify steps - Clone the labs repoThe Bicep + azd and Terraform tracks, the notebooks, and the code samples
You've done the one-time setup that this lab uses.
- Complete Federate MCP tools behind one endpoint and
Control which tools agents can call. This lab governs the
learnMCP server, and you edit its Tool availability the same way you did in lab 05. - A Microsoft Agent 365 tenant, and a tenant administrator who can grant tenant-level consent in the Microsoft 365 admin center. After consent, Agent 365 administrators don't need Azure permissions of their own. Without Agent 365, you can still do the AI Gateway steps, and each blocking step shows how to get the same denial with the gateway's own controls.
- Permission to edit the MCP server in the AI Gateway portal, for example Contributor on the gateway's resource group, and a runtime API key from AccessAPI keys. To use the gateway's Built-in all-access API key, open its More actions menu, select View keys, then Copy API key.
- Run the scripts and samples from the lab's folder,
~/aigateway/labs/20-agent-365-governance.
The Agent 365 integration is in preview. Labels and behavior can change; see the release note. Agent 365 is licensed separately.
Set these variables once. The steps and the Verify section reuse them.
# Set your resource group and gateway, and the MCP server that this lab governs
export RG="<resource-group>"
export GATEWAY="<gateway>"
export MCP_SERVER="learn"
echo "📝 MCP server $MCP_SERVER on gateway $GATEWAY in $RG"
# Read the gateway's runtime URL, which the test script calls
export AI_GATEWAY_URL="https://$(az aigateway show -g "$RG" -n "$GATEWAY" --query properties.frontend.defaultHostname -o tsv)"
echo "🌐 Runtime URL: $AI_GATEWAY_URL"
# Paste the runtime key from Access › API keys without showing it, and don't commit it or write it to a file
printf "AI Gateway API key: " && read -rs AI_GATEWAY_API_KEY && export AI_GATEWAY_API_KEY && echo
echo "🔑 Key: in AI_GATEWAY_API_KEY (${#AI_GATEWAY_API_KEY} characters, not shown)"# Set your resource group and gateway, and the MCP server that this lab governs
$RG = "<resource-group>"
$GATEWAY = "<gateway>"
$MCP_SERVER = "learn"
Write-Host "📝 MCP server $MCP_SERVER on gateway $GATEWAY in $RG"
# Read the gateway's runtime URL, which the test script calls
$env:AI_GATEWAY_URL = "https://$(az aigateway show -g $RG -n $GATEWAY --query properties.frontend.defaultHostname -o tsv)"
Write-Host "🌐 Runtime URL: $env:AI_GATEWAY_URL"
# Paste the runtime key from Access › API keys without showing it, and don't commit it or write it to a file
$env:AI_GATEWAY_API_KEY = Read-Host "AI Gateway API key" -MaskInput
Write-Host "🔑 Key: in AI_GATEWAY_API_KEY ($($env:AI_GATEWAY_API_KEY.Length) characters, not shown)"How it works
The integration separates governance from enforcement. Microsoft Agent 365 keeps the inventory and the access decisions. Azure AI Gateway enforces them inline on every request to an MCP server, and emits runtime signals for auditing and investigation.
After a tenant administrator consents once, Agent 365 discovers Microsoft.ApiManagement resources across the
tenant's subscriptions, including subscriptions you add later. AI gateways are Microsoft.ApiManagement/aigateways
resources, so Agent 365 lists their MCP servers and tools with metadata such as endpoints, access scopes, and
service identities. When an administrator blocks a server or a tool, Agent 365 uses the gateway's control-plane
operations to update that MCP server. On an AI gateway, its role can only read and update MCP servers, so a block
sets the same properties as the gateway's own controls: the server's access state (accessState) or its list of
blocked tools (blockList). Unblocking sets them back. Existing agents keep using the same gateway endpoints.
| Control | Where you set it | What callers get |
|---|---|---|
| Block a tool (Agent 365) | Admin center › AgentsTools › server › Tools tab | HTTP 200, isError: true, denial code ToolNotAvailable |
| Block a server (Agent 365) | Admin center › AgentsTools › server › Block | HTTP 200 with a JSON-RPC error whose data.code is AccessBlockedByGateway |
| Blocked tools (gateway) | AI Gateway portal › MCP server › EditTools | The tool stays in tools/list, and calls get the same ToolNotAvailable denial |
| MCP server access (gateway) | AI Gateway portal › MCP server › EditBasic info | Blocked: HTTP 200 with a JSON-RPC error whose data.code is AccessBlockedByGateway |
The Agent 365 article describes a managed
return-response policy and HTTP 403 for a blocked server. That applies to API Management tiers. On an AI
gateway, a blocked server answers like the gateway's own MCP server access switch: HTTP 200 with a
JSON-RPC error.
Tool-level blocking needs a static list of allowed tools on the server, so Agent 365 can read the tool list.
It isn't available for servers with dynamic allowed tools: Allow all tools, or name patterns with wildcards
such as learn_*.
| Capability | API Management v2 tiers | Azure AI Gateway |
|---|---|---|
| Centralized MCP server inventory | Yes | Yes |
| Block or unblock MCP servers | Yes | Yes |
| Tool-level blocking | No | Yes |
| Tool activity observability | No | Yes |
| Tool threat protection | No | Yes |
API Management v1 tiers aren't supported.
Publish a static list of allowed tools
Agent 365 can only list and block individual tools when the MCP server publishes a fixed set of tools. You set that in the AI Gateway portal.
Open the Tools section
Open the AI Gateway portal and select your gateway from the gateway switcher.
Select MCP servers, then Microsoft Learn (the learn server), then Edit. Edit opens the whole
server on one page, with Discard and Save at the top. Scroll down to the Tools section.
Allow the exact tool names
Under Tool availability, select Match tools by name pattern. Under Allowed tool name patterns, enter
learn_microsoft_docs_search in the first row. Select Add pattern and enter
learn_microsoft_code_sample_search, then select Add pattern again and enter learn_microsoft_docs_fetch.
Enter the exact names, without * or ?, so the list stays static. Leave Blocked tools empty, so the only
blocks in this lab come from Agent 365. Select Save. The server's details page shows Allowed tools (3) and
Blocked tools None.
A pattern with a wildcard, or Allow all tools, makes the list dynamic, and Agent 365 then can't read this server's tool list. You can still block the whole server from Agent 365, and block single tools under Blocked tools in the AI Gateway portal, as in lab 05.
Check the catalog
List the tools through the gateway. The script runs the MCP handshake with your runtime key and prints the gateway's answer even when a call is blocked.
#!/usr/bin/env bash
# Connects to an AI Gateway MCP server with the MCP Streamable HTTP handshake
# (initialize -> notifications/initialized -> tools/list), prints the published tools, and optionally calls one
# tool. Unlike a plain client, it prints the gateway's answer when a server or tool is blocked, so you can see
# how Agent 365 and gateway controls reach the caller.
#
# Usage:
# export AI_GATEWAY_URL="<gateway-url>"
# export AI_GATEWAY_API_KEY="..." # never commit this value
# ./call-tool.sh [server-name] [tool-name] [arguments-json]
#
# Examples:
# ./call-tool.sh learn
# ./call-tool.sh learn learn_microsoft_docs_search '{"query":"What is Microsoft Agent 365?"}'
# ./call-tool.sh learn learn_microsoft_docs_fetch '{"url":"https://learn.microsoft.com/azure/api-management/agent-365"}'
#
# Requires curl and jq.
set -euo pipefail
SERVER="${1:-learn}"
TOOL="${2:-}"
ARGS="${3:-}"
if [ -z "$ARGS" ]; then ARGS="{}"; fi
: "${AI_GATEWAY_URL:?Set AI_GATEWAY_URL to the gateway runtime URL, for example https://aigw-labs-k3v7qz2m9xw4p.eastus2-01.ai.gateway.azure.com}"
: "${AI_GATEWAY_API_KEY:?Set AI_GATEWAY_API_KEY to a runtime key from Access > API keys}"
command -v jq >/dev/null || { echo "This script needs jq." >&2; exit 1; }
printf '%s' "$ARGS" | jq -e 'type == "object"' >/dev/null || { echo "arguments-json must be a JSON object." >&2; exit 1; }
ENDPOINT="${AI_GATEWAY_URL%/}/default/toolservers/${SERVER}/mcp"
HEADERS=(-H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream")
STATUS="" BODY="" SESSION_ID="" CORRELATION_ID=""
# post <json>: sends one JSON-RPC message and sets STATUS, BODY, CORRELATION_ID, and SESSION_ID (when returned).
post() {
local raw head sid
raw="$(curl -sS --max-time 60 -D - "$ENDPOINT" "${HEADERS[@]}" --data "$1" | tr -d '\r')"
if [[ "$raw" == *$'\n\n'* ]]; then head="${raw%%$'\n\n'*}"; BODY="${raw#*$'\n\n'}"; else head="$raw"; BODY=""; fi
STATUS="$(printf '%s\n' "$head" | awk 'toupper($1) ~ /^HTTP/ {code=$2} END {print code}')"
CORRELATION_ID="$(printf '%s\n' "$head" | awk -F': ' 'tolower($1)=="x-correlation-id" {print $2}')"
sid="$(printf '%s\n' "$head" | awk -F': ' 'tolower($1)=="mcp-session-id" {print $2}')"
if [ -n "$sid" ]; then SESSION_ID="$sid"; fi
}
# response <id>: prints the JSON-RPC response with that id. The body can be JSON or server-sent events.
response() {
if printf '%s\n' "$BODY" | grep -q '^data:'; then
printf '%s\n' "$BODY" | sed -n 's/^data:[[:space:]]*//p'
else
printf '%s\n' "$BODY"
fi | jq -c --argjson id "$1" 'select(type == "object" and .id == $id)' 2>/dev/null || true
}
# require_success <step>: prints the gateway's answer and stops when the HTTP status isn't 2xx.
require_success() {
case "$STATUS" in
2??) ;;
*)
echo "$1: HTTP ${STATUS:-no response}${CORRELATION_ID:+ (x-correlation-id: $CORRELATION_ID)}"
printf '%s\n' "$BODY" | jq . 2>/dev/null || printf '%s\n' "$BODY"
exit 1 ;;
esac
}
echo "MCP endpoint: $ENDPOINT"
post '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"aigateway-labs","version":"1.0"}}}'
require_success "initialize"
PROTOCOL="$(response 1 | jq -r '.result.protocolVersion // empty')"
if [ -z "$PROTOCOL" ]; then echo "initialize returned no result:" >&2; printf '%s\n' "$BODY" >&2; exit 1; fi
HEADERS+=(-H "MCP-Protocol-Version: $PROTOCOL")
if [ -n "$SESSION_ID" ]; then HEADERS+=(-H "Mcp-Session-Id: $SESSION_ID"); fi
post '{"jsonrpc":"2.0","method":"notifications/initialized"}'
require_success "notifications/initialized"
post '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
require_success "tools/list"
LIST="$(response 2)"
if [ -z "$LIST" ] || [ "$(printf '%s' "$LIST" | jq 'has("error")')" = "true" ]; then
echo "tools/list returned an error:" >&2; printf '%s\n' "${LIST:-$BODY}" >&2; exit 1
fi
echo "tools/list: HTTP $STATUS"
printf '%s' "$LIST" | jq -r '.result.tools[].name | " " + .'
if [ -z "$TOOL" ]; then exit 0; fi
echo
echo "tools/call: $TOOL $ARGS"
post "$(jq -cn --arg name "$TOOL" --argjson args "$ARGS" \
'{jsonrpc:"2.0",id:3,method:"tools/call",params:{name:$name,arguments:$args}}')"
require_success "tools/call"
CALL="$(response 3)"
if [ -z "$CALL" ]; then echo "tools/call returned no JSON-RPC response:" >&2; printf '%s\n' "$BODY" >&2; exit 1; fi
echo "HTTP status: $STATUS"
if [ "$(printf '%s' "$CALL" | jq 'has("error")')" = "true" ]; then
echo "JSON-RPC error:"; printf '%s' "$CALL" | jq '.error'
elif [ "$(printf '%s' "$CALL" | jq '.result.isError == true')" = "true" ]; then
echo "isError: true"
printf '%s' "$CALL" | jq -r '.result._meta["com.microsoft.azure.ai.gateway/denial"] // {} |
"Denial code: \(.code // "none")\nCorrelation ID: \(.correlationId // "none")"'
printf '%s' "$CALL" | jq -r '[.result.content[]? | select(.type == "text") | .text] | join("\n")'
else
echo "isError: false (the result was returned)"
printf '%s' "$CALL" | jq -r '[.result.content[]? | select(.type == "text") | .text] | join("\n") | .[0:400]'
echo "..."
fiOn GitHub, open infra/call-tool.sh or infra/call-tool.ps1.
# Make the script executable, once
chmod +x infra/call-tool.sh &&
echo "✅ infra/call-tool.sh is executable"
# Run the MCP handshake with your runtime key, and list the tools that the server publishes
echo "🔧 Tools on MCP server $MCP_SERVER:"
./infra/call-tool.sh "$MCP_SERVER"# Run the MCP handshake with your runtime key, and list the tools that the server publishes
Write-Host "🔧 Tools on MCP server ${MCP_SERVER}:"
./infra/call-tool.ps1 -Server $MCP_SERVER🔧 Tools on MCP server learn:
MCP endpoint: <gateway-url>/default/toolservers/learn/mcp
tools/list: HTTP 200
learn_microsoft_code_sample_search
learn_microsoft_docs_fetch
learn_microsoft_docs_searchThe learn server publishes exactly the three tools you listed.
Connect Agent 365 to your gateways
A tenant administrator grants consent once. The consent gives the Agent 365 service identity the A365 Gateway Policy Operator Azure role at tenant level, so it can discover supported resources in existing and future subscriptions in the tenant. On AI gateways, the role can read gateways and read and update their MCP servers. It can't read the servers' secrets, such as backend keys or headers.
Grant consent
Sign in to the Microsoft 365 admin center as a tenant administrator. Under Agents, select Settings, then Gateways. The Gateways (preview) panel opens. Under Microsoft Azure, check I have reviewed the information access requirements of this gateway and I consent to its use., then turn on Azure API Management service and Azure AI Gateway. After a few seconds, Connected changes from No to Yes. There's nothing to save. By consenting, you let the organization read the tools published through the gateway.
If AgentsSettings doesn't list Gateways, check that the tenant has Agent 365 and that you're signed in as a tenant administrator.
The consent covers every API Management instance and AI gateway in the tenant, not just this gateway, and lets Agent 365 block and unblock their MCP servers and tools. Agree on who may block servers and tools in Agent 365 before you turn it on.
Find your MCP server
Under Agents, select Tools, then select MCP servers on the Registry tab and search for learn.
Your server is the Microsoft Learn row with the type MCP Server, the status Available, your gateway's
name as its Publisher, and AI Gateway as its Source. A Microsoft Learn row from the Catalog
source, published by Microsoft Corporation, can show up too; that one isn't your gateway's server. Agent 365 syncs
the inventory on a schedule, so the server can take several minutes to appear after you grant consent.
Select your Microsoft Learn row. The page has three tabs: Overview, Tools, and Activity. Overview
shows the Server URL, which is your gateway's runtime URL followed by /default/toolservers/learn/mcp, and your
gateway as Source and Publisher. The server's description isn't synced, so About this MCP Server reads
"No description provided." Activity shows calls by agents; the calls that you make with a runtime key in this
lab don't show there.
The learn server from your gateway is in the Agent 365 inventory, with AI Gateway as its source and your
gateway as its publisher.
Block a tool
Your security team decides that agents shouldn't fetch arbitrary pages. You turn off one tool and leave the rest of the server working.
Turn off the tool in Agent 365
In the admin center, under Agents, select Tools, then the learn server. Select the Tools tab and turn
off the switch of learn_microsoft_docs_fetch, so it shows Disabled. Then select Save, and wait for
Changes saved.: saving takes up to about a minute. Agent 365 adds the tool to the server's blocked tools, so the
gateway stops it from running.
To see the change on the gateway, open the AI Gateway portal and select MCP serversMicrosoft Learn. Under
Tools, Blocked tools (1) lists learn_microsoft_docs_fetch. The tool stays under Allowed tools, because
the blocked list wins over the allowed list.
No Agent 365 tenant yet? Rehearse with the gateway's own control, which sets the same list: in the AI Gateway
portal, open MCP serversMicrosoft LearnEdit, select Add blocked tool under Blocked
tools, enter learn_microsoft_docs_fetch, and select Save. The next call gets the same
ToolNotAvailable denial. Remove the row and save again when you turn the tool back on.
Call the blocked tool
# Call the tool that Agent 365 turned off: the gateway answers with a denial instead of running it
echo "🚦 Expect ToolNotAvailable from learn_microsoft_docs_fetch:"
./infra/call-tool.sh "$MCP_SERVER" learn_microsoft_docs_fetch \
'{"url":"https://learn.microsoft.com/azure/api-management/agent-365"}'# Call the tool that Agent 365 turned off: the gateway answers with a denial instead of running it
Write-Host "🚦 Expect ToolNotAvailable from learn_microsoft_docs_fetch:"
./infra/call-tool.ps1 -Server $MCP_SERVER -Tool learn_microsoft_docs_fetch `
-Arguments '{"url":"https://learn.microsoft.com/azure/api-management/agent-365"}'🚦 Expect ToolNotAvailable from learn_microsoft_docs_fetch:
...
tools/call: learn_microsoft_docs_fetch {"url":"https://learn.microsoft.com/azure/api-management/agent-365"}
HTTP status: 200
isError: true
Denial code: ToolNotAvailable
Correlation ID: <guid>
Tool 'learn_microsoft_docs_fetch' is blocked by the gateway. Do not retry this tool.The message text can differ; the denial code is what matters. The call returns HTTP 200 with a JSON-RPC
result, not an HTTP error. The isError flag and the "Do not retry" text tell the agent the tool is off on
purpose, so a well-behaved agent stops retrying it. The documented response, for a tool named delete_file, is:
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"content": [
{ "type": "text", "text": "Tool 'delete_file' is blocked by the gateway. Do not retry this tool." }
],
"isError": true,
"_meta": {
"com.microsoft.azure.ai.gateway/denial": {
"code": "ToolNotAvailable",
"correlationId": "9f2c1b6e-..."
}
}
}
}Call a tool that's still allowed
# Call a tool that's still allowed: the search runs and returns results
echo "🔧 Calling learn_microsoft_docs_search on MCP server $MCP_SERVER:"
./infra/call-tool.sh "$MCP_SERVER" learn_microsoft_docs_search '{"query":"What is Microsoft Agent 365?"}'# Call a tool that's still allowed: the search runs and returns results
Write-Host "🔧 Calling learn_microsoft_docs_search on MCP server ${MCP_SERVER}:"
./infra/call-tool.ps1 -Server $MCP_SERVER -Tool learn_microsoft_docs_search `
-Arguments '{"query":"What is Microsoft Agent 365?"}'The search returns results with isError: false.
Turn the tool back on
In the admin center, on the learn server's Tools tab, turn the switch of learn_microsoft_docs_fetch back
on, so it shows Enabled, and select Save. Once Changes saved. shows, the tool is off the gateway's
blocked list and runs again.
While the tool was off, calls to it returned ToolNotAvailable and the other tools kept working.
Block the whole server
During an incident, you may need to cut off every tool on a server at once. Blocking the server in Agent 365 sets its access state to blocked, so the gateway answers before it reaches any backend.
Block the server in Agent 365
In the admin center, under Agents, select Tools, select the learn server, and select Block at the top
right. Block Microsoft Learn warns that your users won't have access to this MCP server while it's blocked.
Select Block.
The status changes from Available to Blocked, and the button changes to Unblock. In the AI Gateway portal, the server's MCP status shows Blocked.
To rehearse without Agent 365, set the same access state in the AI Gateway portal: open MCP serversMicrosoft LearnEdit, turn off the MCP server access switch in Basic info so it shows Blocked, and select Save.
Try to connect
# Try the MCP handshake again: the gateway rejects every request to the blocked server
echo "🚦 Expect AccessBlockedByGateway from MCP server $MCP_SERVER:"
./infra/call-tool.sh "$MCP_SERVER"# Try the MCP handshake again: the gateway rejects every request to the blocked server
Write-Host "🚦 Expect AccessBlockedByGateway from MCP server ${MCP_SERVER}:"
./infra/call-tool.ps1 -Server $MCP_SERVER🚦 Expect AccessBlockedByGateway from MCP server learn:
MCP endpoint: <gateway-url>/default/toolservers/learn/mcp
initialize returned no result:
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"Access to MCP server \u0027learn\u0027 is blocked.","data":{"code":"AccessBlockedByGateway","target":"learn","correlationId":"<guid>"}}}The call returns HTTP 200 with a JSON-RPC error, not an HTTP error, so the script stops after initialize. The
message names your server. Every request to the server, including initialize and tools/list, gets the same
error, and the backend isn't called. call-tool.ps1 shows the same JSON in an initialize returned an error
exception.
Unblock the server
In the admin center, on the learn server's page, select Unblock. There's no confirmation: the status changes
back to Available, and a banner confirms that Microsoft Learn has been unblocked. Agent 365 sets the access
state back to active, and within about half a minute the script lists the tools again. If you rehearsed in the AI
Gateway portal, turn the MCP server access switch back on, so it shows Active, and save.
While the server was blocked, every request returned the JSON-RPC error AccessBlockedByGateway. After you
unblocked it, the handshake and tools/list succeed.
Verify
Confirm the inventory
In the admin center, under AgentsTools, the learn server is listed with your gateway as its publisher
and AI Gateway as its source, its status is Available, and its Tools tab shows all three tools enabled.
Confirm the server works end to end
# List the tools and call the search tool, to confirm that no Agent 365 block is left on the server
echo "🔧 Tools on MCP server $MCP_SERVER, and a call to learn_microsoft_docs_search:"
./infra/call-tool.sh "$MCP_SERVER" learn_microsoft_docs_search '{"query":"What is Microsoft Agent 365?"}'# List the tools and call the search tool, to confirm that no Agent 365 block is left on the server
Write-Host "🔧 Tools on MCP server ${MCP_SERVER}, and a call to learn_microsoft_docs_search:"
./infra/call-tool.ps1 -Server $MCP_SERVER -Tool learn_microsoft_docs_search `
-Arguments '{"query":"What is Microsoft Agent 365?"}'tools/list returns the three tools, and the search returns isError: false.
Trace a denial
Each denial carries a correlation ID, in the x-correlation-id response header and in the response body. Record
it with the agent's logs, so you can match a blocked call with the gateway's runtime signals. If you set up
Application Insights in Monitor usage, cost, and traces, MonitoringTools
shows the server's tool executions and Traces shows each request.
Go further
- Close the side door. Agent 365 doesn't route agents through the gateway for you. Each agent must use the gateway's MCP endpoint, and a block only works if agents can't reach the MCP server directly. Restrict the backend so the gateway is its only caller, for example with private networking.
- Add threat protection. On Azure AI Gateway, add Agent 365 tool threat protection so Microsoft Defender and Microsoft Purview evaluate the calls that you allow.
- Decide who owns which switch. Agent 365 blocks are tenant-wide governance decisions. The gateway's own Blocked tools and MCP server access settings belong to the platform team. Write down which team uses which control, so a block set in one place isn't undone in the other.
- Govern every server the same way. For servers that Agent 365 governs, list exact tool names under Match tools by name pattern, without wildcards. New tools then stay unpublished until someone reviews and adds them.
Clean up
Clear Agent 365 blocks
In the admin center, make sure the learn server isn't blocked and all its tools are enabled. The gateway
consent is tenant-wide, so leave it on if your organization plans to keep using the integration. Otherwise, ask a
tenant administrator to review Azure API Management service and Azure AI Gateway under AgentsSettingsGateways.
Restore the tool availability
In the AI Gateway portal, open MCP serversMicrosoft LearnEdit. If you rehearsed with the gateway's own controls, check that MCP server access shows Active and that Blocked tools is empty. Under Tools, select Allow all tools, then select Save.