Skip to main content
Glama
tarun7r

cricket-mcp-server

get_live_matches

Retrieve live cricket match details from Cricbuzz, including match descriptions and URLs, using the MCP server for cricket data.

Instructions

Get live cricket matches from Cricbuzz.

Returns: list: A list of dictionaries, each containing the match description and a URL. Example: [{"match": "IND vs AUS...", "url": "https://..."}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements get_live_matches by scraping the Cricbuzz live scores page to extract and return a list of currently live cricket matches with their descriptions and URLs.
    @mcp.tool()
    def get_live_matches() -> list:
        """Get live cricket matches from Cricbuzz.
        
        Returns:
            list: A list of dictionaries, each containing the match description and a URL.
                  Example: [{"match": "IND vs AUS...", "url": "https://..."}]
        """
        link = "https://www.cricbuzz.com/cricket-match/live-scores"
        try:
            response = requests.get(link, headers=HEADERS, timeout=10)
            response.raise_for_status()  # Raise an exception for bad status codes
            source = response.text
            page = BeautifulSoup(source, "lxml")
    
            container = page.find("div", id="page-wrapper")
            if not container:
                return [{"error": "Could not find the main page wrapper"}]
                
            matches = container.find_all("div", class_="cb-mtch-lst")
            live_matches = []
    
            for match in matches:
                description_tag = match.find("a", class_="text-hvr-underline")
                if description_tag:
                    match_text = description_tag.text.strip()
                    url_suffix = description_tag.get("href")
                    
                    if url_suffix:
                        url = "https://www.cricbuzz.com" + url_suffix
                        live_matches.append({"match": match_text, "url": url})
            
            return live_matches
    
        except requests.exceptions.ConnectionError as e:
            return [{"error": f"Connection error: {str(e)}"}]
        except requests.exceptions.Timeout as e:
            return [{"error": f"Request timeout: {str(e)}"}]
        except requests.exceptions.HTTPError as e:
            return [{"error": f"HTTP error: {str(e)}"}]
        except Exception as e:
            return [{"error": f"Failed to get live matches: {str(e)}"}]
  • The @mcp.tool() decorator registers the get_live_matches function as an MCP tool.
    @mcp.tool()
  • The docstring provides the schema description for the tool's input (none) and output (list of dicts with 'match' and 'url').
    """Get live cricket matches from Cricbuzz.
    
    Returns:
        list: A list of dictionaries, each containing the match description and a URL.
              Example: [{"match": "IND vs AUS...", "url": "https://..."}]
    """
  • Reference to get_live_matches in the docstring of the get_match_details tool.
    match_url (str): The URL of the match on Cricbuzz (can be obtained from get_live_matches).
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return format (list of dictionaries with match description and URL) and provides an example, which is helpful. However, it doesn't mention important behavioral aspects like whether this requires authentication, rate limits, or how frequently the data updates.

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

Conciseness4/5

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

The description is efficiently structured with a clear purpose statement followed by return format details and an example. Every sentence adds value, though the example could be slightly more concise.

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

Completeness3/5

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

For a parameterless tool with no annotations and no output schema, the description provides adequate information about what the tool returns. However, it lacks context about data freshness, potential limitations, or how it differs from sibling tools, leaving some gaps in understanding when and how to use it effectively.

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?

Since there are 0 parameters (schema coverage is 100%), the baseline score is 4. The description appropriately doesn't discuss parameters, focusing instead on the return value, which is correct for a parameterless tool.

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 the action ('Get live cricket matches') and source ('from Cricbuzz'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_match_details' or 'get_cricket_schedule', which might also involve match information.

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 'get_match_details' for specific matches or 'get_cricket_schedule' for upcoming matches. It simply states what the tool does without context about appropriate use cases.

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