Skip to content

Conversation

@yenayuu
Copy link

@yenayuu yenayuu commented Nov 12, 2025

Summary

Created MCP shopping agent tool

Related issue(s)

Fixes #

Signed-off-by: Yena Yu <yenayu@bu.edu>
@yenayuu yenayuu force-pushed the add-shopping-agent-mcp branch from e29da6f to 831211f Compare November 12, 2025 08:16
@esnible
Copy link
Contributor

esnible commented Nov 12, 2025

I see that the PR includes instructions for using the tool. The instructions require an OpenAI key and a SerpAPI key. Can this be run without those keys?

@yenayuu
Copy link
Author

yenayuu commented Nov 12, 2025

I see that the PR includes instructions for using the tool. The instructions require an OpenAI key and a SerpAPI key. Can this be run without those keys?

no it would need those two API Keys to run

@mrsabath
Copy link
Contributor

@yenayuu, once we are done with this PR, please open a new issue, similar to this one: kagenti/kagenti#405 so we can add this Agent to our Demo collection

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Shopping Agent MCP tool that provides AI-powered product recommendations using LangChain, LangGraph, OpenAI, and SerpAPI. The tool implements a sophisticated multi-step workflow to understand natural language queries, search for products across retailers, and generate personalized recommendations with reasoning.

Key changes include:

  • Implementation of a LangGraph-based agent workflow for intelligent shopping recommendations
  • Integration with OpenAI for natural language understanding and generation
  • SerpAPI integration for real-time product search across retailers
  • Comprehensive documentation covering architecture, quickstart, and troubleshooting

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mcp/shopping_agent/shopping_agent.py Core MCP server implementation with LangGraph workflow and tool definitions
mcp/shopping_agent/pyproject.toml Project dependencies including FastMCP, LangChain, LangGraph, OpenAI, and SerpAPI
mcp/shopping_agent/README.md Comprehensive documentation with features, setup, usage, and troubleshooting
mcp/shopping_agent/QUICKSTART.md Quick start guide with step-by-step setup and usage examples
mcp/shopping_agent/ARCHITECTURE.md Detailed architecture documentation covering components, data flow, and integration
mcp/shopping_agent/TROUBLESHOOTING.md Troubleshooting guide for common errors and testing methods
mcp/shopping_agent/Dockerfile Container configuration for Docker deployment
mcp/shopping_agent/test_simple.py Direct function testing script bypassing MCP protocol
mcp/shopping_agent/test_client.py HTTP client for testing MCP server endpoints
mcp/shopping_agent/test_mcp_client.py MCP SDK-based test client
mcp/shopping_agent/test_server.sh Shell script for server health checks and MCP protocol testing
mcp/shopping_agent/simple_test.py Standalone test demonstrating LangGraph agent without MCP layer
mcp/shopping_agent/setup_env.sh Helper script for environment setup with API keys
mcp/shopping_agent/config.example Example configuration file for environment variables
mcp/shopping_agent/init.py Package initialization exporting main functions
mcp/shopping_agent/.gitignore Git ignore patterns for secrets, Python artifacts, and IDE files
mcp/README.md Updated MCP tools directory documentation including Shopping Agent
Comments suppressed due to low confidence (1)

mcp/shopping_agent/QUICKSTART.md:1

  • The reference to movie_tool is unclear since this tool is not mentioned elsewhere in the Shopping Agent documentation. Consider removing this reference or adding context about what the movie_tool is.
# Shopping Agent - Quick Start Guide

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

parsed_data = json.loads(response.content)
product = parsed_data.get("product", "product")
budget = parsed_data.get("budget", "unknown")
except:
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bare except clause catches all exceptions including SystemExit and KeyboardInterrupt. Use specific exception types like except (json.JSONDecodeError, ValueError): to catch only expected errors.

Suggested change
except:
except (json.JSONDecodeError, ValueError):

Copilot uses AI. Check for mistakes.
"description": content,
"note": "Please refine your search for more specific results"
}]
except Exception as e:
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider catching specific exception types like json.JSONDecodeError and ValueError rather than catching all exceptions. This makes error handling more explicit and prevents catching unexpected errors.

Suggested change
except Exception as e:
except (json.JSONDecodeError, ValueError) as e:

Copilot uses AI. Check for mistakes.
parsed_data = json.loads(response.content)
product = parsed_data.get("product", "product")
budget = parsed_data.get("budget", "unknown")
except:
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bare except clause catches all exceptions including SystemExit and KeyboardInterrupt. Use specific exception types like except (json.JSONDecodeError, ValueError): to catch only expected errors.

Suggested change
except:
except (json.JSONDecodeError, ValueError):

Copilot uses AI. Check for mistakes.
"description": content,
"note": "Please refine your search for more specific results"
}]
except Exception as e:
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider catching specific exception types like json.JSONDecodeError and ValueError rather than catching all exceptions. This makes error handling more explicit and prevents catching unexpected errors.

Suggested change
except Exception as e:
except (json.JSONDecodeError, ValueError) as e:

Copilot uses AI. Check for mistakes.
@yenayuu yenayuu closed this Nov 23, 2025
@yenayuu
Copy link
Author

yenayuu commented Nov 23, 2025

Duplicated to PR #100 #101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants