Skip to main content
Glama

get_mlb_linescore

Retrieve detailed linescore data for a specific MLB game using its unique game ID. Access inning-by-inning scores, team performance, and game status through the MLB statistics API.

Instructions

Get linescore for a specific game by game_id.

Args: game_id (int): The game ID.

Returns: dict: Linescore information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
game_idYes

Implementation Reference

  • The handler function implementing the logic for the get_mlb_linescore tool. It retrieves the linescore for a given game ID using the MLB API and returns it or an error.
    @mcp.tool() def get_mlb_linescore(game_id: int) -> dict: """ Get linescore for a specific game by game_id. Args: game_id (int): The game ID. Returns: dict: Linescore information. """ try: linescore = mlb.get_game_line_score(game_id) return linescore except Exception as e: return {"error": str(e)}
  • main.py:22-22 (registration)
    Invocation of setup_mlb_tools(mcp) in the main server file, which defines and registers the get_mlb_linescore tool (and other MLB tools) with the MCP server.
    setup_mlb_tools(mcp)

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/guillochon/mlb-api-mcp'

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