Add comment to sample

This commit is contained in:
Tao Chen
2026-06-04 16:23:42 -07:00
Unverified
parent d322d0e7a4
commit 34c2e2cf57
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -1439,7 +1439,8 @@ class MCPTool:
continue
except Exception as reconn_ex:
raise ToolExecutionException(
"Failed to reconnect to MCP server.", inner_exception=reconn_ex
"Failed to reconnect to MCP server.",
inner_exception=reconn_ex,
) from reconn_ex
# Second attempt also failed, give up.
@@ -46,6 +46,8 @@ async def github_mcp_example() -> None:
# The MCP tool manages the connection to the MCP server and makes its tools available
# Set approval_mode="never_require" to allow the MCP tool to execute without approval
client = OpenAIChatClient()
# Note that the tool created here will be executed remotely by OpenAI, not locally by
# your application.
github_mcp_tool = client.get_mcp_tool(
name="GitHub",
url="https://api.githubcopilot.com/mcp/",