search_live_commentary
Fetch real-time cricket match commentary and updates by entering match details or team names, providing instant web search results for live match insights.
Instructions
Search for live commentary and updates for cricket matches on the web.
Args: match_description (str, optional): Full match description (e.g., "Zimbabwe vs New Zealand 2nd Test") team1 (str, optional): First team name team2 (str, optional): Second team name
Returns: list: Web search results for live commentary and match updates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match_description | No | ||
| team1 | No | ||
| team2 | No |
Implementation Reference
- cricket_server.py:725-765 (handler)The handler function for the 'search_live_commentary' tool. It is decorated with @mcp.tool(), which handles both registration and schema definition via type hints. The function constructs a search query and uses the 'web_search' tool to find live commentary from Cricbuzz, ESPN Cricinfo, and general web results.@mcp.tool() def search_live_commentary(match_description: str = None, team1: str = None, team2: str = None) -> list: """ Search for live commentary and updates for cricket matches on the web. Args: match_description (str, optional): Full match description (e.g., "Zimbabwe vs New Zealand 2nd Test") team1 (str, optional): First team name team2 (str, optional): Second team name Returns: list: Web search results for live commentary and match updates """ if not match_description and not (team1 and team2): return [{"error": "Please provide either match_description or both team1 and team2"}] # Build search query if match_description: query = f"live commentary {match_description} cricket" else: query = f"live commentary {team1} vs {team2} cricket" # Search with cricket news sites results = [] # Try Cricbuzz cricbuzz_results = web_search(query, num_results=3, site_filter="cricbuzz.com") if cricbuzz_results and "error" not in cricbuzz_results[0]: results.extend(cricbuzz_results) # Try ESPN Cricinfo espn_results = web_search(query, num_results=3, site_filter="espncricinfo.com") if espn_results and "error" not in espn_results[0]: results.extend(espn_results) # General search general_results = web_search(query, num_results=5) if general_results and "error" not in general_results[0]: results.extend(general_results) return results[:10] # Limit to 10 results