Skip to content

Commit 920a296

Browse files
committed
editorial adjustments
1 parent 7f9e92e commit 920a296

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Use this article to find code samples for connecting Azure AI Foundry Agent Serv
1919

2020
:::zone pivot="python"
2121

22-
## Initialization
22+
## Initialize the client
2323

2424
The code begins by setting up the necessary imports, getting the relevant MCP server configuration, and initializing the AI Project client:
2525

@@ -30,7 +30,7 @@ from azure.ai.projects import AIProjectClient
3030
from azure.identity import DefaultAzureCredential
3131
from azure.ai.agents.models import McpTool, RequiredMcpToolCall, SubmitToolApprovalAction, ToolApproval
3232

33-
# Get MCP server configuration from environment variables
33+
# Get the MCP server configuration from environment variables
3434
mcp_server_url = os.environ.get("MCP_SERVER_URL", "https://gitmcp.io/Azure/azure-rest-api-specs")
3535
mcp_server_label = os.environ.get("MCP_SERVER_LABEL", "github")
3636

@@ -42,7 +42,7 @@ project_client = AIProjectClient(
4242

4343
## Set up the tool
4444

45-
To add the MCP server to the agent, use the following example. The example takes the MCP server label and URL from the last step. You can also add or remove allowed tools dynamically through the `allow_tool` parameter.
45+
To add the MCP server to the agent, use the following example, which takes the MCP server label and URL from the last step. You can also add or remove allowed tools dynamically through the `allow_tool` parameter.
4646

4747
```python
4848
mcp_tool = McpTool(
@@ -63,12 +63,12 @@ You create an agent by using the `project_client.agents.create_agent` method:
6363

6464
```python
6565
# Create a new agent.
66-
# NOTE: To reuse existing agent, fetch it with get_agent(agent_id)
66+
# NOTE: To reuse an existing agent, fetch it with get_agent(agent_id)
6767
with project_client:
6868
agents_client = project_client.agents
6969

7070
# Create a new agent.
71-
# NOTE: To reuse existing agent, fetch it with get_agent(agent_id)
71+
# NOTE: To reuse an existing agent, fetch it with get_agent(agent_id)
7272
agent = agents_client.create_agent(
7373
model=os.environ["MODEL_DEPLOYMENT_NAME"],
7474
name="my-mcp-agent",
@@ -101,7 +101,7 @@ Set the MCP server update headers and optionally disable tool approval requireme
101101

102102
```python
103103
mcp_tool.update_headers("SuperSecret", "123456")
104-
# mcp_tool.set_approval_mode("never") # Uncomment to disable approval requirement
104+
# mcp_tool.set_approval_mode("never") # Uncomment to disable approval requirements
105105
run = agents_client.runs.create(thread_id=thread.id, agent_id=agent.id, tool_resources=mcp_tool.resources)
106106
print(f"Created run, ID: {run.id}")
107107
```

0 commit comments

Comments
 (0)