Skip to main content
Glama
tarun7r

cricket-mcp-server

web_search

Perform targeted web searches for cricket-related information, retrieve relevant links with titles and snippets, and filter results by specific sites for focused queries.

Instructions

General web search for cricket-related queries. Returns links with titles and snippets.

Args: query (str): Search query num_results (int): Number of results to return (max ~10 typical) site_filter (str, optional): If provided, prefixes the query with e.g. "site:cricbuzz.com"

Returns: list[dict]: [{"title": str, "url": str, "snippet": str}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
num_resultsNo
queryYes
site_filterNo

Implementation Reference

  • The main handler function for the 'web_search' MCP tool. It performs a general web search (using the googlesearch library), optionally restricted to a site, and enriches results with page titles and meta descriptions by fetching each page.
    @mcp.tool() def web_search(query: str, num_results: int = 5, site_filter: str | None = None) -> list: """ General web search for cricket-related queries. Returns links with titles and snippets. Args: query (str): Search query num_results (int): Number of results to return (max ~10 typical) site_filter (str, optional): If provided, prefixes the query with e.g. "site:cricbuzz.com" Returns: list[dict]: [{"title": str, "url": str, "snippet": str}] """ if not query: return [{"error": "query is required"}] q = query.strip() if site_filter: q = f"site:{site_filter} " + q results = [] try: links = search(q, num_results=max(1, min(num_results, 10))) except Exception as e: return [{"error": f"Search failed: {str(e)}"}] for url in links: item = {"url": url} try: resp = requests.get(url, headers=HEADERS, timeout=8) resp.raise_for_status() page = BeautifulSoup(resp.text, "lxml") title = page.find("title") desc = page.find("meta", attrs={"name": "description"}) item["title"] = title.text.strip() if title and title.text else url item["snippet"] = desc["content"].strip() if desc and desc.get("content") else "" except Exception: item["title"] = url item["snippet"] = "" results.append(item) return results

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tarun7r/cricket-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server