Skip to main content
Glama
jay-arora31

IPL MCP Server

by jay-arora31

query_ipl_data

Query IPL cricket data using natural language to get player statistics, team performances, and match results from the dataset.

Instructions

Query IPL cricket data using natural language. Examples: - 'Show me all matches in the dataset' - 'Which team won the most matches?' - 'Who scored the most runs across all matches?' - 'What was the highest total score?' - 'Show matches played in Mumbai' - 'Who has the best bowling figures?' - 'Show me Virat Kohli batting stats' - 'What's the average first innings score?' - 'Show me all centuries scored' - 'Which venue has the highest scoring matches?'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query about IPL cricket data

Implementation Reference

  • Tool call handler in the MCP server that routes 'query_ipl_data' to the QueryEngine.
    @self.server.call_tool()
    async def handle_call_tool(name: str, arguments: Dict[str, Any]) -> List[TextContent]:
        """Handle tool calls"""
        if name == "query_ipl_data":
            query = arguments.get("query", "")
            if not query:
                return [TextContent(type="text", text="Please provide a query.")]
            
            try:
                result = self.query_engine.process_query(query)
                return [TextContent(type="text", text=result)]
            except Exception as e:
                return [TextContent(type="text", text=f"Error processing query: {str(e)}")]
        
        return [TextContent(type="text", text=f"Unknown tool: {name}")]
  • The core logic that parses the query using regex patterns and dispatches it to the appropriate data handling method.
    def process_query(self, query: str) -> str:
        """Process natural language query and return formatted results"""
        query_lower = query.lower().strip()
        
        # Try to match query patterns
        for pattern_info in self.query_patterns:
            pattern = pattern_info['pattern']
            handler = pattern_info['handler']
            
            match = re.search(pattern, query_lower)
            if match:
                try:
                    # Extract parameters from regex groups if any
                    groups = match.groups()
                    params = [g.strip() if g else None for g in groups if g and g.strip()]
                    
                    result = handler(*params) if params else handler()
                    return self.format_result(result, pattern_info['description'])
                except Exception as e:
                    return f"Error executing query: {str(e)}"
        
        # If no pattern matches, try to handle as a general query
        return self.handle_general_query(query)
  • Tool definition, including schema and description.
    Tool(
        name="query_ipl_data",
        description="""Query IPL cricket data using natural language. 
        Examples:
        - 'Show me all matches in the dataset'
        - 'Which team won the most matches?'
        - 'Who scored the most runs across all matches?'
        - 'What was the highest total score?'
        - 'Show matches played in Mumbai'
        - 'Who has the best bowling figures?'
        - 'Show me Virat Kohli batting stats'
        - 'What's the average first innings score?'
        - 'Show me all centuries scored'
        - 'Which venue has the highest scoring matches?'
        """,
        inputSchema={
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "Natural language query about IPL cricket data"
                }
            },
            "required": ["query"]
        }
    )
Behavior2/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 of behavioral disclosure. It mentions the tool accepts natural language queries but does not describe response format, error handling, data scope (e.g., which seasons), limitations, or performance traits. The examples hint at capabilities but lack explicit behavioral details.

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

Conciseness3/5

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

The description is front-loaded with a clear purpose statement, but the extensive list of 10 examples adds bulk without proportional value. Some examples are redundant (e.g., multiple 'Show me' queries), and the structure could be more streamlined by grouping or summarizing query types.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It does not explain what the tool returns (e.g., data format, structure), potential errors, or data limitations. For a query tool with unspecified output, this leaves significant gaps for an AI agent to use it effectively.

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

Parameters3/5

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

The input schema has 100% description coverage, with the parameter 'query' documented as 'Natural language query about IPL cricket data.' The description adds minimal value beyond this, as it restates the natural language aspect in the first sentence and provides examples. Baseline 3 is appropriate since the schema does the heavy lifting.

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 tool's purpose: 'Query IPL cricket data using natural language.' This specifies the verb ('query'), resource ('IPL cricket data'), and input method ('natural language'). However, with no sibling tools provided, it cannot demonstrate differentiation from alternatives, preventing a perfect score.

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 explicit guidance on when to use this tool versus alternatives. It lists examples of queries but does not mention prerequisites, constraints, or scenarios where this tool is appropriate. Without sibling tools, it cannot reference alternatives, but it still lacks basic usage context.

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

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/jay-arora31/ipl-match-mcp-server'

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