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
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that it returns 'links with titles and snippets' and mentions 'max ~10 typical' for results, which adds useful context about output format and limitations. However, it doesn't cover important behavioral aspects like rate limits, authentication needs, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, args, returns), front-loaded with the main purpose, and every sentence adds value. No wasted words while maintaining completeness for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters with 0% schema coverage and no output schema, the description does a good job explaining parameters and return format. It could be more complete by addressing when to use versus siblings and more behavioral details, but it covers the essential aspects adequately for this search tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear semantic explanations for all 3 parameters: 'query' as search query, 'num_results' with typical max, and 'site_filter' with syntax example. This adds substantial value beyond the bare schema, though it could elaborate more on parameter interactions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'General web search for cricket-related queries' with specific verb ('search') and resource ('web'), and mentions it returns 'links with titles and snippets'. However, it doesn't explicitly differentiate from sibling tools like 'search_live_commentary' or 'get_cricket_news', which might also involve searching cricket content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_live_commentary' or 'get_cricket_news'. It mentions it's for 'cricket-related queries' but doesn't specify scenarios where web search is preferred over the more specialized sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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