Skip to main content
Glama
tarun7r

cricket-mcp-server

get_cricket_news

Fetch cricket news updates with headlines, descriptions, timestamps, categories, and direct article URLs using a reliable MCP server for cricket data.

Instructions

Get the latest cricket news from Cricbuzz.

Returns: list: A list of dictionaries, each containing news details including headline, description, timestamp, category, and a direct URL to the article.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The @mcp.tool() decorator registers the get_cricket_news function as an MCP tool.
    @mcp.tool()
  • Function signature with no input parameters and return type list[str], along with docstring describing the tool's purpose and output format.
    def get_cricket_news() -> list:
        """
        Get the latest cricket news from Cricbuzz.
        
        Returns:
            list: A list of dictionaries, each containing news details including headline,
                  description, timestamp, category, and a direct URL to the article.
        """
  • The complete implementation of the get_cricket_news tool handler. It fetches the latest cricket news from Cricbuzz by scraping the news page, parsing headlines, descriptions, timestamps, categories, and constructing URLs for each news item. Includes error handling for network issues.
    @mcp.tool()
    def get_cricket_news() -> list:
        """
        Get the latest cricket news from Cricbuzz.
        
        Returns:
            list: A list of dictionaries, each containing news details including headline,
                  description, timestamp, category, and a direct URL to the article.
        """
        link = "https://www.cricbuzz.com/cricket-news"
        try:
            response = requests.get(link, headers=HEADERS, timeout=10)
            response.raise_for_status()
            source = response.text
            page = BeautifulSoup(source, "lxml")
    
            news_list = []
            news_container = page.find("div", id="news-list")
            if not news_container:
                return [{"error": "Could not find the news container"}]
    
            stories = news_container.find_all("div", class_="cb-col cb-col-100 cb-lst-itm cb-pos-rel cb-lst-itm-lg")
    
            for story in stories:
                news_item = {}
                
                headline_tag = story.find("a", class_="cb-nws-hdln-ancr")
                if headline_tag:
                    news_item["headline"] = headline_tag.get("title", "").strip()
                    news_item["url"] = "https://www.cricbuzz.com" + headline_tag.get("href", "")
    
                description_tag = story.find("div", class_="cb-nws-intr")
                if description_tag:
                    news_item["description"] = description_tag.text.strip()
    
                time_tag = story.find("span", class_="cb-nws-time")
                if time_tag:
                    news_item["timestamp"] = time_tag.text.strip()
    
                category_tag = story.find("div", class_="cb-nws-time")
                if category_tag:
                    category_text = category_tag.text.strip()
                    if "•" in category_text:
                        parts = category_text.split("•")
                        if len(parts) > 1:
                            news_item["category"] = parts[1].strip()
    
                if news_item:
                    news_list.append(news_item)
    
            return news_list
        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 cricket news: {str(e)}"}]
Behavior2/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 states the tool returns a list of news details, which is helpful, but lacks critical information such as whether it's a read-only operation, potential rate limits, authentication needs, or data freshness (e.g., how 'latest' is defined). This leaves significant gaps in understanding the tool's behavior beyond basic output.

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 front-loaded with the core purpose in the first sentence, followed by a clear 'Returns:' section detailing the output structure. Every sentence adds value: the first explains what the tool does, and the second specifies the return format. There is no wasted text, making it efficient and well-structured.

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?

Given the tool's low complexity (0 parameters, no annotations, no output schema), the description is minimally complete. It explains the purpose and return format, which is adequate for a simple read operation. However, it lacks context on behavioral aspects like data sources or limitations, which could be important for an agent to use it effectively, especially without annotations to fill those gaps.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the return value. This meets the baseline for tools with no parameters, as it doesn't add unnecessary information beyond what the schema provides.

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 verb 'Get' and the resource 'latest cricket news from Cricbuzz', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_cricket_schedule' or 'web_search', which could also provide cricket-related information but through different mechanisms or sources.

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. It doesn't mention sibling tools like 'get_cricket_schedule' for schedules or 'web_search' for broader searches, leaving the agent without context for tool selection. The only implied usage is for retrieving cricket news, but no exclusions or comparisons are provided.

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