Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cloud_engineer_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
aws_diagram_mcp_client = None

# Get tools from MCP clients (if initialized)
docs_tools = aws_docs_mcp_client.list_tools_sync() if mcp_initialized and aws_docs_mcp_client else []
diagram_tools = aws_diagram_mcp_client.list_tools_sync() if mcp_initialized and aws_diagram_mcp_client else []
docs_tools = aws_docs_mcp_client.list_tools_sync() if mcp_initialized and aws_docs_mcp_client is not None else []
diagram_tools = aws_diagram_mcp_client.list_tools_sync() if mcp_initialized and aws_diagram_mcp_client is not None else []

# Create a BedrockModel with system inference profile
bedrock_model = BedrockModel(
Expand Down Expand Up @@ -155,14 +155,14 @@

# Register cleanup handler for MCP clients
def cleanup():
if mcp_initialized:
if mcp_initialized and aws_docs_mcp_client is not None:
try:
aws_docs_mcp_client.stop()
print("AWS Documentation MCP client stopped")
except Exception as e:
print(f"Error stopping AWS Documentation MCP client: {e}")

if mcp_initialized:
if mcp_initialized and aws_diagram_mcp_client is not None:
try:
aws_diagram_mcp_client.stop()
print("AWS Diagram MCP client stopped")
Expand Down