get_mlb_awards
Retrieve MLB award recipients by specifying the award ID. This tool provides detailed information on winners, enabling integration of baseball award data into applications.
Instructions
Get award recipients for a specific award.
Args: award_id (int): Award ID.
Returns: dict: Award recipients.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| award_id | Yes |
Implementation Reference
- mlb_api.py:636-652 (handler)The core handler function for the 'get_mlb_awards' tool, decorated with @mcp.tool(). It fetches award recipients for the given award_id using the mlbstatsapi.Mlb() instance and returns the data or an error.@mcp.tool() def get_mlb_awards(award_id: int) -> dict: """ Get award recipients for a specific award. Args: award_id (int): Award ID. Returns: dict: Award recipients. """ try: awards = mlb.get_awards(award_id) return {"awards": awards} except Exception as e: return {"error": str(e)}
- main.py:22-22 (registration)Invocation of setup_mlb_tools(mcp) which defines and registers the get_mlb_awards tool (among others) with the MCP server instance.setup_mlb_tools(mcp)