You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
46
46
47
47
```python
48
48
mcp_tool = McpTool(
@@ -63,12 +63,12 @@ You create an agent by using the `project_client.agents.create_agent` method:
63
63
64
64
```python
65
65
# 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)
67
67
with project_client:
68
68
agents_client = project_client.agents
69
69
70
70
# 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)
72
72
agent = agents_client.create_agent(
73
73
model=os.environ["MODEL_DEPLOYMENT_NAME"],
74
74
name="my-mcp-agent",
@@ -101,7 +101,7 @@ Set the MCP server update headers and optionally disable tool approval requireme
101
101
102
102
```python
103
103
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
105
105
run = agents_client.runs.create(thread_id=thread.id, agent_id=agent.id, tool_resources=mcp_tool.resources)
0 commit comments