Skip to main content
Glama

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
NameRequiredDescriptionDefault
award_idYes

Implementation Reference

  • 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)

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