Install
openclaw skills install nba-stats一个提供实时和历史NBA数据的模型上下文协议服务器,包括球员统计、比赛得分、球队信息和高级分析。
openclaw skills install nba-stats一个提供实时和历史NBA数据的模型上下文协议服务器,包括球员统计、比赛得分、球队信息和高级分析。
此 Skill 必须配置 API 密钥才能使用。
.env 中没有 XBY_APIKEY,必须使用 AskUserQuestion 工具向用户询问 API 密钥scripts.config.set_api_key(api_key) 保存,然后继续处理你(大模型)是路由层,负责理解用户意图、选择工具、提取参数。代码只负责调用API。
用户输入 → 你选择工具 → 提取该工具需要的参数 → 调用 scripts.tools 中的函数 → 返回结果给用户
scripts.config.settings.api_key 为空,使用 AskUserQuestion 询问用户,拿到后调用 scripts.config.set_api_key(key) 保存scripts.tools 中的函数,例如 scripts.tools.search_schools(score='520', province='北京', category='综合')raw 数据整理后展示给用户根据用户意图选择对应的工具函数:
| 用户意图 | 工具函数 |
|---|---|
| Server version + runtime settings (timeouts, retries, cache, concurrency). | scripts.tools.get_server_info |
| Resolve team name/city/nickname → team_id. | scripts.tools.resolve_team_id |
| Resolve player name → player_id (official stats endpoint). | scripts.tools.resolve_player_id |
| Find game_id by date and matchup. If date omitted, finds most recent matchup via schedule. | scripts.tools.find_game_id |
| Today's games. | scripts.tools.get_todays_scoreboard |
| Games for a specific date. | scripts.tools.get_scoreboard_by_date |
| Detailed game info for a specific game_id. | scripts.tools.get_game_details |
| Full box score for a game_id. | scripts.tools.get_box_score |
| Search players by name substring. | scripts.tools.search_players |
| Player bio/profile info. | scripts.tools.get_player_info |
| Player stats for a season. | scripts.tools.get_player_season_stats |
| Player game log for a season. | scripts.tools.get_player_game_log |
| Player career totals/averages. | scripts.tools.get_player_career_stats |
| Player hustle stats. | scripts.tools.get_player_hustle_stats |
| League leaders in a hustle stat category. | scripts.tools.get_league_hustle_leaders |
| Opponent FG% when defended by player. | scripts.tools.get_player_defense_stats |
| All-time leaders for a stat category. | scripts.tools.get_all_time_leaders |
| All teams. | scripts.tools.get_all_teams |
| Team roster. | scripts.tools.get_team_roster |
| League standings. | scripts.tools.get_standings |
| Current season per-game league leaders for a stat category (Points/Assists/Rebounds/etc.). | scripts.tools.get_league_leaders |
| Team upcoming schedule. | scripts.tools.get_schedule |
| Player awards/accolades. | scripts.tools.get_player_awards |
| Major awards for a season. | scripts.tools.get_season_awards |
| Shot chart data summary. | scripts.tools.get_shot_chart |
| Shooting splits summary. | scripts.tools.get_shooting_splits |
| Play-by-play summary. | scripts.tools.get_play_by_play |
| Rotation/substitution summary. | scripts.tools.get_game_rotation |
| Player advanced metrics summary. | scripts.tools.get_player_advanced_stats |
| Team advanced metrics summary. | scripts.tools.get_team_advanced_stats |
如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具描述:Server version + runtime settings (timeouts, retries, cache, concurrency).
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Resolve team name/city/nickname → team_id.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| query | string | true | null | |
| limit | integer | false | null |
工具描述:Resolve player name → player_id (official stats endpoint).
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| query | string | true | null | |
| active_only | boolean | false | null | |
| limit | integer | false | null |
工具描述:Find game_id by date and matchup. If date omitted, finds most recent matchup via schedule.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| date | string | false | null | |
| home_team | string | false | null | |
| away_team | string | false | null | |
| team | string | false | null | |
| lookback_days | integer | false | null | |
| limit | integer | false | null |
工具描述:Today's games.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Games for a specific date.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| date | string | true | null |
工具描述:Detailed game info for a specific game_id.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| game_id | string | true | null |
工具描述:Full box score for a game_id.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| game_id | string | true | null |
工具描述:Search players by name substring.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| query | string | true | null |
工具描述:Player bio/profile info.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null |
工具描述:Player stats for a season.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null |
工具描述:Player game log for a season.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null |
工具描述:Player career totals/averages.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null |
工具描述:Player hustle stats.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null |
工具描述:League leaders in a hustle stat category.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| stat_category | string | false | null | |
| season | string | false | null |
工具描述:Opponent FG% when defended by player.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null |
工具描述:All-time leaders for a stat category.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| stat_category | string | false | null | |
| limit | integer | false | null |
工具描述:All teams.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Team roster.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| team_id | string | true | null | |
| season | string | false | null |
工具描述:League standings.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| season | string | false | null |
工具描述:Current season per-game league leaders for a stat category (Points/Assists/Rebounds/etc.).
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| stat_type | string | false | Stat type like 'Points', 'Assists', 'Rebounds', 'Steals', 'Blocks', 'FG%', '3P%', 'FT%' | |
| season | string | false | Season in format YYYY-YY (defaults to current season) | |
| limit | integer | false | Number of leaders to return (default 10, max 50) |
工具描述:Team upcoming schedule.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| team_id | string | true | null | |
| days_ahead | integer | false | null |
工具描述:Player awards/accolades.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null |
工具描述:Major awards for a season.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| season | string | false | null |
工具描述:Shot chart data summary.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null | |
| game_id | string | false | null |
工具描述:Shooting splits summary.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null |
工具描述:Play-by-play summary.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| game_id | string | true | null | |
| start_period | integer | false | null | |
| end_period | integer | false | null |
工具描述:Rotation/substitution summary.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| game_id | string | true | null |
工具描述:Player advanced metrics summary.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| player_id | string | true | null | |
| season | string | false | null |
工具描述:Team advanced metrics summary.
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| team_id | string | true | null | |
| season | string | false | null |
工具函数返回 dict 对象:
result["raw"] - API 原始返回数据(JSON),直接将此数据整理后展示给用户result["success"] - 是否成功(True/False)result["message"] - 状态消息xiaobenyang_gaokao_skill/
├── scripts/
│ ├── __init__.py
│ ├── config.py # 配置管理 + set_api_key()
│ ├── call_api.py # API 客户端 + call_api()
│ └── tools.py # 工具函数(直接调用)
├── requirements.txt
└── SKILL.md