Install
openclaw skills install fantasynbaleague一个为Fantasy NBA以色列联赛提供统计数据、排名和分析的MCP服务器。
openclaw skills install fantasynbaleague一个为Fantasy NBA以色列联赛提供统计数据、排名和分析的MCP服务器。
此 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 数据整理后展示给用户根据用户意图选择对应的工具函数:
| 用户意图 | 工具函数 |
|---|---|
| Get the average league rankings from the API. |
IMPORTANT - SCORING SYSTEM EXPLANATION: This is a ROTISSERIE (ROTO) fantasy league. Teams earn ranking points in 8 categories.
CRITICAL: Do NOT confuse "ranking points" with "rank position"!
HOW RANKING POINTS WORK:
EXAMPLE in a 12-team league: { "team": {"team_name": "Best Team"}, "ast": 12.0, // Earned 12 pts (1st place in assists) "reb": 11.0, // Earned 11 pts (2nd place in rebounds) "stl": 8.0, // Earned 8 pts (5th place in steals) ...other categories... "total_points": 73.0, // Sum of all 8 category points "rank": 1, // Overall standing: 1st place "GP": 55 // Games played (informational only, not ranked) }
Args: order: Sort order for rankings. - "desc" = best to worst (top teams first, "from top to bottom", "מלמעלה למטה") - "asc" = worst to best (bottom teams first, "from bottom to top", "מלמטה למעלה") Default is "desc".
Returns: A list of teams with their rankings, total points, and stats per category. Each item in the list is a dictionary with the following keys: { "team": { "team_id": <team_id>, "team_name": <team_name> }, "fg_percentage": <ranking_points_for_field_goal_percentage>, "ft_percentage": <ranking_points_for_free_throw_percentage>, "three_pm": <ranking_points_for_three_pointers_made>, "ast": <ranking_points_for_assists>, "reb": <ranking_points_for_rebounds>, "stl": <ranking_points_for_steals>, "blk": <ranking_points_for_blocks>, "pts": <ranking_points_for_points>, "total_points": <sum_of_all_category_ranking_points>, "rank": <overall_position_1_is_first_place>, "GP": <games_played_not_ranked> }
NOTES:
scripts.tools.getAveragesLeagueRankings |
|
Get the list of all teams in the fantasy league.Use this endpoint to discover team IDs for use with other endpoints like getTeamDetails().
Returns: A list of teams with their team_id and team_name. Each item in the list is a dictionary with the following keys: { "team_id": <integer_team_identifier>, "team_name": <string_team_name> }
NOTES:
scripts.tools.getTeams |
|
Get the average statistics (actual performance numbers) for all teams from the API.IMPORTANT: This returns ACTUAL PERFORMANCE STATS, NOT ranking points!
Args: use_normalized: If True, returns normalized data (0-1 scale) for comparison. If False, returns raw statistical values (e.g., 45.6% FG, 12.3 AST). Default is False.
Returns: A list of teams with their actual statistical averages per game. Each item in the list is a dictionary with the following structure: { "team": { "team_id": <team_id>, "team_name": <team_name> }, "stats": { "FG%": <field_goal_percentage_as_decimal>, "FT%": <free_throw_percentage_as_decimal>, "3PM": <three_pointers_made_per_game>, "AST": <assists_per_game>, "REB": <rebounds_per_game>, "STL": <steals_per_game>, "BLK": <blocks_per_game>, "PTS": <points_per_game>, "GP": <games_played> } }
NOTES:
scripts.tools.getAverageStats |
|
Get comprehensive details for a specific team from the API.This endpoint combines multiple data types for a single team:
IMPORTANT - Understanding the Data Sections:
"raw_averages" = Actual statistical performance (e.g., 45.6% FG, 12.3 assists per game) "ranking_stats" = Rotisserie points earned in each category (see explanation below) "category_ranks" = Ordinal position in each category (1=1st place, 2=2nd place, etc.) "shot_chart" = Raw totals for field goals and free throws (not averages)
RANKING STATS EXPLANATION (Same as getAveragesLeagueRankings): This is a ROTISSERIE (ROTO) fantasy league. Teams earn ranking points in 8 categories.
CRITICAL: Do NOT confuse "ranking points" with "category ranks"!
HOW RANKING POINTS WORK:
Args: team_id: The ID of the team to get details for. Use getTeams() to see all team IDs.
Returns: A dictionary containing comprehensive team information: { "team": { "team_id": <team_id>, "team_name": <team_name> }, "espn_url": <espn_team_page_url_string>,
"shot_chart": {
"team": {"team_id": <id>, "team_name": <name>},
"fgm": <total_field_goals_made>,
"fga": <total_field_goals_attempted>,
"fg_percentage": <calculated_field_goal_percentage_as_decimal>,
"ftm": <total_free_throws_made>,
"fta": <total_free_throws_attempted>,
"ft_percentage": <calculated_free_throw_percentage_as_decimal>,
"gp": <games_played>
},
"raw_averages": {
"fg_percentage": <average_field_goal_percentage_as_decimal>,
"ft_percentage": <average_free_throw_percentage_as_decimal>,
"three_pm": <average_three_pointers_made_per_game>,
"ast": <average_assists_per_game>,
"reb": <average_rebounds_per_game>,
"stl": <average_steals_per_game>,
"blk": <average_blocks_per_game>,
"pts": <average_points_per_game>,
"gp": <games_played>,
"team": {"team_id": <id>, "team_name": <name>}
},
"ranking_stats": {
"team": {"team_id": <id>, "team_name": <name>},
"fg_percentage": <ranking_points_earned_in_fg_percentage>,
"ft_percentage": <ranking_points_earned_in_ft_percentage>,
"three_pm": <ranking_points_earned_in_three_pointers>,
"ast": <ranking_points_earned_in_assists>,
"reb": <ranking_points_earned_in_rebounds>,
"stl": <ranking_points_earned_in_steals>,
"blk": <ranking_points_earned_in_blocks>,
"pts": <ranking_points_earned_in_points>,
"gp": <games_played_not_ranked>,
"total_points": <sum_of_all_8_category_ranking_points>,
"rank": <overall_standing_1_is_first_place>
},
"category_ranks": {
"FG%": <ranking_points_earned_in_fg_percentage>,
"FT%": <ranking_points_earned_in_ft_percentage>,
"3PM": <ranking_points_earned_in_three_pointers>,
"AST": <ranking_points_earned_in_assists>,
"REB": <ranking_points_earned_in_rebounds>,
"STL": <ranking_points_earned_in_steals>,
"BLK": <ranking_points_earned_in_blocks>,
"PTS": <ranking_points_earned_in_points>
},
"players": [
{
"player_name": <player_full_name_string>,
"pro_team": <nba_team_abbreviation_string>,
"positions": <list_of_eligible_positions>,
"stats": {
"pts": <average_points_per_game>,
"reb": <average_rebounds_per_game>,
"ast": <average_assists_per_game>,
"stl": <average_steals_per_game>,
"blk": <average_blocks_per_game>,
"fgm": <average_field_goals_made_per_game>,
"fga": <average_field_goals_attempted_per_game>,
"ftm": <average_free_throws_made_per_game>,
"fta": <average_free_throws_attempted_per_game>,
"fg_percentage": <field_goal_percentage_as_decimal>,
"ft_percentage": <free_throw_percentage_as_decimal>,
"three_pm": <average_three_pointers_made_per_game>,
"minutes": <average_minutes_per_game>,
"gp": <total_games_played>
},
"team_id": <fantasy_team_id>
}
]
}
EXAMPLE - Understanding the Different Data Types: If a team shows:
NOTES:
scripts.tools.getTeamDetails |
|
Get league-wide shooting statistics (field goals and free throws) for all teams.This endpoint provides CUMULATIVE TOTALS (not per-game averages) for shooting stats. Useful for understanding overall team shooting efficiency across the season.
Returns: A dictionary containing league-wide shooting statistics: { "shots": [ { "team": { "team_id": <team_id>, "team_name": <team_name> }, "fgm": <total_field_goals_made>, "fga": <total_field_goals_attempted>, "fg_percentage": <calculated_field_goal_percentage_as_decimal>, "ftm": <total_free_throws_made>, "fta": <total_free_throws_attempted>, "ft_percentage": <calculated_free_throw_percentage_as_decimal>, "gp": <games_played> } ] }
NOTES:
scripts.tools.getLeagueShotsStats |如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具描述: Get the average league rankings from the API.
IMPORTANT - SCORING SYSTEM EXPLANATION: This is a ROTISSERIE (ROTO) fantasy league. Teams earn ranking points in 8 categories.
CRITICAL: Do NOT confuse "ranking points" with "rank position"!
HOW RANKING POINTS WORK:
EXAMPLE in a 12-team league: { "team": {"team_name": "Best Team"}, "ast": 12.0, // Earned 12 pts (1st place in assists) "reb": 11.0, // Earned 11 pts (2nd place in rebounds) "stl": 8.0, // Earned 8 pts (5th place in steals) ...other categories... "total_points": 73.0, // Sum of all 8 category points "rank": 1, // Overall standing: 1st place "GP": 55 // Games played (informational only, not ranked) }
Args: order: Sort order for rankings. - "desc" = best to worst (top teams first, "from top to bottom", "מלמעלה למטה") - "asc" = worst to best (bottom teams first, "from bottom to top", "מלמטה למעלה") Default is "desc".
Returns: A list of teams with their rankings, total points, and stats per category. Each item in the list is a dictionary with the following keys: { "team": { "team_id": <team_id>, "team_name": <team_name> }, "fg_percentage": <ranking_points_for_field_goal_percentage>, "ft_percentage": <ranking_points_for_free_throw_percentage>, "three_pm": <ranking_points_for_three_pointers_made>, "ast": <ranking_points_for_assists>, "reb": <ranking_points_for_rebounds>, "stl": <ranking_points_for_steals>, "blk": <ranking_points_for_blocks>, "pts": <ranking_points_for_points>, "total_points": <sum_of_all_category_ranking_points>, "rank": <overall_position_1_is_first_place>, "GP": <games_played_not_ranked> }
NOTES:
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| order | string | false | "desc" | null |
工具描述: Get the list of all teams in the fantasy league.
Use this endpoint to discover team IDs for use with other endpoints like getTeamDetails().
Returns: A list of teams with their team_id and team_name. Each item in the list is a dictionary with the following keys: { "team_id": <integer_team_identifier>, "team_name": <string_team_name> }
NOTES:
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述: Get the average statistics (actual performance numbers) for all teams from the API.
IMPORTANT: This returns ACTUAL PERFORMANCE STATS, NOT ranking points!
Args: use_normalized: If True, returns normalized data (0-1 scale) for comparison. If False, returns raw statistical values (e.g., 45.6% FG, 12.3 AST). Default is False.
Returns: A list of teams with their actual statistical averages per game. Each item in the list is a dictionary with the following structure: { "team": { "team_id": <team_id>, "team_name": <team_name> }, "stats": { "FG%": <field_goal_percentage_as_decimal>, "FT%": <free_throw_percentage_as_decimal>, "3PM": <three_pointers_made_per_game>, "AST": <assists_per_game>, "REB": <rebounds_per_game>, "STL": <steals_per_game>, "BLK": <blocks_per_game>, "PTS": <points_per_game>, "GP": <games_played> } }
NOTES:
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| use_normalized | boolean | false | false | null |
工具描述: Get comprehensive details for a specific team from the API.
This endpoint combines multiple data types for a single team:
IMPORTANT - Understanding the Data Sections:
"raw_averages" = Actual statistical performance (e.g., 45.6% FG, 12.3 assists per game) "ranking_stats" = Rotisserie points earned in each category (see explanation below) "category_ranks" = Ordinal position in each category (1=1st place, 2=2nd place, etc.) "shot_chart" = Raw totals for field goals and free throws (not averages)
RANKING STATS EXPLANATION (Same as getAveragesLeagueRankings): This is a ROTISSERIE (ROTO) fantasy league. Teams earn ranking points in 8 categories.
CRITICAL: Do NOT confuse "ranking points" with "category ranks"!
HOW RANKING POINTS WORK:
Args: team_id: The ID of the team to get details for. Use getTeams() to see all team IDs.
Returns: A dictionary containing comprehensive team information: { "team": { "team_id": <team_id>, "team_name": <team_name> }, "espn_url": <espn_team_page_url_string>,
"shot_chart": {
"team": {"team_id": <id>, "team_name": <name>},
"fgm": <total_field_goals_made>,
"fga": <total_field_goals_attempted>,
"fg_percentage": <calculated_field_goal_percentage_as_decimal>,
"ftm": <total_free_throws_made>,
"fta": <total_free_throws_attempted>,
"ft_percentage": <calculated_free_throw_percentage_as_decimal>,
"gp": <games_played>
},
"raw_averages": {
"fg_percentage": <average_field_goal_percentage_as_decimal>,
"ft_percentage": <average_free_throw_percentage_as_decimal>,
"three_pm": <average_three_pointers_made_per_game>,
"ast": <average_assists_per_game>,
"reb": <average_rebounds_per_game>,
"stl": <average_steals_per_game>,
"blk": <average_blocks_per_game>,
"pts": <average_points_per_game>,
"gp": <games_played>,
"team": {"team_id": <id>, "team_name": <name>}
},
"ranking_stats": {
"team": {"team_id": <id>, "team_name": <name>},
"fg_percentage": <ranking_points_earned_in_fg_percentage>,
"ft_percentage": <ranking_points_earned_in_ft_percentage>,
"three_pm": <ranking_points_earned_in_three_pointers>,
"ast": <ranking_points_earned_in_assists>,
"reb": <ranking_points_earned_in_rebounds>,
"stl": <ranking_points_earned_in_steals>,
"blk": <ranking_points_earned_in_blocks>,
"pts": <ranking_points_earned_in_points>,
"gp": <games_played_not_ranked>,
"total_points": <sum_of_all_8_category_ranking_points>,
"rank": <overall_standing_1_is_first_place>
},
"category_ranks": {
"FG%": <ranking_points_earned_in_fg_percentage>,
"FT%": <ranking_points_earned_in_ft_percentage>,
"3PM": <ranking_points_earned_in_three_pointers>,
"AST": <ranking_points_earned_in_assists>,
"REB": <ranking_points_earned_in_rebounds>,
"STL": <ranking_points_earned_in_steals>,
"BLK": <ranking_points_earned_in_blocks>,
"PTS": <ranking_points_earned_in_points>
},
"players": [
{
"player_name": <player_full_name_string>,
"pro_team": <nba_team_abbreviation_string>,
"positions": <list_of_eligible_positions>,
"stats": {
"pts": <average_points_per_game>,
"reb": <average_rebounds_per_game>,
"ast": <average_assists_per_game>,
"stl": <average_steals_per_game>,
"blk": <average_blocks_per_game>,
"fgm": <average_field_goals_made_per_game>,
"fga": <average_field_goals_attempted_per_game>,
"ftm": <average_free_throws_made_per_game>,
"fta": <average_free_throws_attempted_per_game>,
"fg_percentage": <field_goal_percentage_as_decimal>,
"ft_percentage": <free_throw_percentage_as_decimal>,
"three_pm": <average_three_pointers_made_per_game>,
"minutes": <average_minutes_per_game>,
"gp": <total_games_played>
},
"team_id": <fantasy_team_id>
}
]
}
EXAMPLE - Understanding the Different Data Types: If a team shows:
NOTES:
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| team_id | integer | true | null |
工具描述: Get league-wide shooting statistics (field goals and free throws) for all teams.
This endpoint provides CUMULATIVE TOTALS (not per-game averages) for shooting stats. Useful for understanding overall team shooting efficiency across the season.
Returns: A dictionary containing league-wide shooting statistics: { "shots": [ { "team": { "team_id": <team_id>, "team_name": <team_name> }, "fgm": <total_field_goals_made>, "fga": <total_field_goals_attempted>, "fg_percentage": <calculated_field_goal_percentage_as_decimal>, "ftm": <total_free_throws_made>, "fta": <total_free_throws_attempted>, "ft_percentage": <calculated_free_throw_percentage_as_decimal>, "gp": <games_played> } ] }
NOTES:
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具函数返回 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