Skip to main content
Glama

get_mlb_player_info

Retrieve detailed player information by ID using a FastAPI-based MLB data integration tool. Enables access to baseball statistics and player data for AI applications and analysis.

Instructions

Get information about a specific player by ID.

Args: player_id (int): The player ID.

Returns: dict: Player information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_idYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the core logic for retrieving MLB player information by player ID using the mlbstatsapi library.
    @mcp.tool() def get_mlb_player_info(player_id: int) -> dict: """ Get information about a specific player by ID. Args: player_id (int): The player ID. Returns: dict: Player information. """ try: player_info = mlb.get_person(player_id) return {"player_info": player_info} except Exception as e: return {"error": str(e)}
  • main.py:22-22 (registration)
    The call to setup_mlb_tools(mcp) in the main server file, which defines and registers the get_mlb_player_info tool along with other MLB tools.
    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