mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: fix(ag-ui): add MCP tool support for AG-UI approval flows (#3212)
* add MCP tool support for AG-UI approval flows * use attribute in place of property
This commit is contained in:
committed by
GitHub
Unverified
parent
80b25a782b
commit
620da7a829
@@ -114,10 +114,10 @@ class AgentFrameworkExecutor:
|
||||
Args:
|
||||
agent: Agent object that may have MCP tools
|
||||
"""
|
||||
if not hasattr(agent, "_local_mcp_tools"):
|
||||
if not hasattr(agent, "mcp_tools"):
|
||||
return
|
||||
|
||||
for mcp_tool in agent._local_mcp_tools:
|
||||
for mcp_tool in agent.mcp_tools:
|
||||
if not getattr(mcp_tool, "is_connected", False):
|
||||
continue
|
||||
|
||||
|
||||
@@ -248,9 +248,9 @@ class DevServer:
|
||||
except Exception as e:
|
||||
logger.warning(f"Error closing credential for {entity_info.id}: {e}")
|
||||
|
||||
# Close MCP tools (framework tracks them in _local_mcp_tools)
|
||||
if entity_obj and hasattr(entity_obj, "_local_mcp_tools"):
|
||||
for mcp_tool in entity_obj._local_mcp_tools:
|
||||
# Close MCP tools (framework tracks them in mcp_tools)
|
||||
if entity_obj and hasattr(entity_obj, "mcp_tools"):
|
||||
for mcp_tool in entity_obj.mcp_tools:
|
||||
if hasattr(mcp_tool, "close") and callable(mcp_tool.close):
|
||||
try:
|
||||
if inspect.iscoroutinefunction(mcp_tool.close):
|
||||
|
||||
Reference in New Issue
Block a user