Skip to main content
Glama
lenwood

cfbd-mcp-server

by lenwood

get-games-teams

Retrieve college football team game data from the College Football Data API by specifying parameters like year, week, team, or conference.

Instructions

Note: When using this tool, please explicitly mention that you are retrieving data from the College Football Data API. You must mention "College Football Data API" in every response.

Get college football team game data.
        Required: year plus at least one of: week, team or conference.
        Example valid queries:
        - year=2023, team="Alabama"
        - year=2023, week=1
        - year=2023, conference="SEC
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
weekNo
season_typeNo
teamNo
conferenceNo
game_idNo
classificationNo

Implementation Reference

  • The MCP tool handler function that dispatches 'get-games-teams' to the CFBD API /games/teams endpoint after schema validation. This is the core execution logic for all tools including get-games-teams.
    @server.call_tool()
    async def handle_call_tool(
        name: str,
        arguments: dict[str, Any] | None
    ) -> list[types.TextContent]:
        """Handle tool execution requests."""
        if not arguments:
            raise ValueError("Arguments are required")
    
        # Map tool names to their parameter schemas
        schema_map = {
            "get-games": getGames,
            "get-records": getTeamRecords,
            "get-games-teams": getGamesTeams,
            "get-plays": getPlays,
            "get-drives": getDrives,
            "get-play-stats": getPlayStats,
            "get-rankings": getRankings,
            "get-pregame-win-probability": getMetricsPregameWp,
            "get-advanced-box-score": getAdvancedBoxScore
        }
    
        if name not in schema_map:
            raise ValueError(f"Unknown tool: {name}")
    
        # Validate parameters against schema
        try:
            validated_params = validate_params(arguments, schema_map[name])
        except ValueError as e:
            return [types.TextContent(
                type="text",
                text=f"Validation error: {str(e)}"
            )]
    
        endpoint_map = {
            "get-games": "/games",
            "get-records": "/records",
            "get-games-teams": "/games/teams",
            "get-plays": "/plays",
            "get-drives": "/drives",
            "get-play-stats": "/play/stats",
            "get-rankings": "/rankings",
            "get-pregame-win-probability": "/metrics/wp/pregame",
            "get-advanced-box-score": "/game/box/advanced"
        }
       
        async with await get_api_client() as client:
            try:
                response = await client.get(endpoint_map[name], params=arguments)
                response.raise_for_status()
                data = response.json()
                return [types.TextContent(
                    type="text",
                    text=str(data)
                )]
            except httpx.HTTPStatusError as e:
                if e.response.status_code == 401:
                    return [types.TextContent(
                        type="text",
                        text="401: API authentication failed. Please check your API key."
                    )]
                elif e.response.status_code == 403:
                    return [types.TextContent(
                        type="text",
                        text="403: API access forbidden. Please check your permission."
                    )]
                elif e.response.status_code == 429:
                    return [types.TextContent(
                        type="text",
                        text="429: Rate limit exceeded. Please try again later."
                    )]
                else:
                    return [types.TextContent(
                        type="text",
                        text=f"API Error: {e}"
                    )]
            except httpx.RequestError as e:
                return [types.TextContent(
                    type="text",
                    text=f"Network error: {str(e)}"
                )]
  • TypedDict schemas defining input parameters and response structure for the get-games-teams tool, used for validation and type hints.
    class getGamesTeams(TypedDict): # /games/teams endpoint
        year: int
        week: Optional[int]
        season_type: Optional[str]
        team: Optional[str]
        conference: Optional[str]
        game_id: Optional[int]
        classification: Optional[str]
    
    class GamesTeamsResponse(TypedDict): # /games/teams response
        id: int
        teams: List[Team]
  • MCP tool registration in list_tools(): defines the tool name, description, and input schema for server advertisement.
    types.Tool(
        name="get-games-teams",
        description=base_description + """Get college football team game data.
        Required: year plus at least one of: week, team or conference.
        Example valid queries:
        - year=2023, team="Alabama"
        - year=2023, week=1
        - year=2023, conference="SEC
        """,
        inputSchema=create_tool_schema(getGamesTeams)
    ),
  • Maps the tool name to its input schema class for parameter validation during tool calls.
    schema_map = {
        "get-games": getGames,
        "get-records": getTeamRecords,
        "get-games-teams": getGamesTeams,
        "get-plays": getPlays,
        "get-drives": getDrives,
        "get-play-stats": getPlayStats,
        "get-rankings": getRankings,
        "get-pregame-win-probability": getMetricsPregameWp,
        "get-advanced-box-score": getAdvancedBoxScore
    }
  • Maps the tool name to the CFBD API endpoint path (/games/teams) used in the HTTP request.
    endpoint_map = {
        "get-games": "/games",
        "get-records": "/records",
        "get-games-teams": "/games/teams",
        "get-plays": "/plays",
        "get-drives": "/drives",
        "get-play-stats": "/play/stats",
        "get-rankings": "/rankings",
        "get-pregame-win-probability": "/metrics/wp/pregame",
        "get-advanced-box-score": "/game/box/advanced"
    }
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 that data comes from the 'College Football Data API' and requires attribution in responses, which adds useful context about data source and output formatting. However, it lacks details on rate limits, error handling, authentication needs, or what the return data structure looks like (e.g., pagination, fields included). For a tool with 7 parameters and no annotations, this is a significant gap.

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 appropriately sized but not optimally structured. The first sentence about API attribution is front-loaded but not core to the tool's functionality, while the essential usage rules and examples follow. Some sentences could be more efficient (e.g., the examples could be integrated more smoothly). Overall, it's clear but could be more streamlined.

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 the complexity (7 parameters, no annotations, no output schema), the description is incomplete. It covers basic usage and examples but lacks details on parameter meanings, return format, error conditions, and behavioral traits like rate limits. For a data retrieval tool with multiple filtering options, this leaves too many gaps for reliable agent invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter documentation. The description compensates by listing required parameters (year plus at least one of week, team, or conference) and giving examples, but it doesn't explain the semantics of all 7 parameters (e.g., what 'season_type', 'classification', or 'game_id' represent). This leaves most parameters undocumented, failing to fully compensate for the schema gap.

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: 'Get college football team game data.' It specifies the verb ('Get') and resource ('college football team game data'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get-games' or 'get-advanced-box-score', which might have overlapping functionality.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: it requires a year plus at least one additional parameter (week, team, or conference), and gives three example valid queries. This helps the agent understand the necessary conditions for invocation. However, it doesn't explicitly mention when not to use it or suggest alternatives among 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

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/lenwood/cfbd-mcp-server'

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