-
Notifications
You must be signed in to change notification settings - Fork 21
✨ Shopping Agent MCP Tool #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Yena Yu <yenayu@bu.edu>
e29da6f to
831211f
Compare
|
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 |
|
@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 |
There was a problem hiding this 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_toolis 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: |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
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.
| except: | |
| except (json.JSONDecodeError, ValueError): |
| "description": content, | ||
| "note": "Please refine your search for more specific results" | ||
| }] | ||
| except Exception as e: |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
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.
| except Exception as e: | |
| except (json.JSONDecodeError, ValueError) as e: |
| parsed_data = json.loads(response.content) | ||
| product = parsed_data.get("product", "product") | ||
| budget = parsed_data.get("budget", "unknown") | ||
| except: |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
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.
| except: | |
| except (json.JSONDecodeError, ValueError): |
| "description": content, | ||
| "note": "Please refine your search for more specific results" | ||
| }] | ||
| except Exception as e: |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
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.
| except Exception as e: | |
| except (json.JSONDecodeError, ValueError) as e: |
Summary
Created MCP shopping agent tool
Related issue(s)
Fixes #