get_statcast_pitcher
Retrieve MLB Statcast pitching data for a specific pitcher within a defined date range to analyze performance metrics and trends.
Instructions
Retrieve MLB Statcast data for a single pitcher over a date range.
Parameters
player_id : int MLBAM ID of the pitcher. start_date : str The start date in 'YYYY-MM-DD' format. Required. end_date : str The end date in 'YYYY-MM-DD' format. Required.
Returns
dict Dictionary with Statcast data for the pitcher. If the result is too large, returns an error message.
Notes
Data is sourced from MLB Statcast via pybaseball. See the official documentation for more details: https://github.com/jldbc/pybaseball/tree/master/docs
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player_id | Yes | ||
| start_date | Yes | ||
| end_date | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tests/test_mlb_api.py:26-32 (registration)Test fixture that calls mlb_api.setup_mlb_tools(mcp) to register the tools, including get_statcast_pitcher, confirming the registration mechanism.
@pytest.fixture def mcp(): mcp = MagicMock() patch_mcp_tool(mcp) mlb_api.setup_mlb_tools(mcp) generic_api.setup_generic_tools(mcp) return mcp