Your existing code will continue to work without any changes. All original tools are preserved.
# Your existing code works as-is
summary = await get_player_summary("Name", "Tag")
matches = await get_recent_matches_tool("Name", "Tag")Benefits of staying on v1.0 interface:
- No code changes needed
- Familiar string output format
- Continue using existing patterns
Consider migrating to new tools when:
- Adding new features
- Refactoring existing code
- Building new applications
- Needs JSON responses for better data access
# Old tools for display
display_summary = await get_player_summary("Name", "Tag")
print(display_summary) # Formatted string with emojis
# New tools for data processing
data_summary = await lol_get_player_summary("Name", "Tag")
tier = data_summary['soloRank']['tier'] # Direct accessReplace all old tool calls with new ones:
Before:
summary = await get_player_summary("Name", "Tag")
champions = await get_top_champions_tool("Name", "Tag")
matches = await get_recent_matches_tool("Name", "Tag")
mastery = await get_champion_mastery_tool("Name", "Tag", "Amumu")
match_detail = await get_match_summary("NA1_123", "puuid-here")After:
summary = await lol_get_player_summary("Name", "Tag")
champions = await lol_get_top_champions("Name", "Tag")
matches = await lol_get_recent_matches("Name", "Tag")
mastery = await lol_get_champion_mastery("Name", "Tag", "Amumu")
match_detail = await lol_get_match_details("NA1_123", "puuid-here")Old (v1.0):
summary = await get_player_summary("Air Coots", "Prime")
print(summary)
# Output: Pretty formatted string with emojis ✨New (v2.0) - Option A: Keep displaying strings
# No change needed! Keep using old tool
summary = await get_player_summary("Air Coots", "Prime")
print(summary) # Still works perfectlyNew (v2.0) - Option B: Custom formatted display
summary = await lol_get_player_summary("Air Coots", "Prime")
# Build custom format
display = f"""
👤 {summary['gameName']} (Level {summary['level']})
🏅 Rank: {summary['soloRank']['tier']} {summary['soloRank']['rank']}
🔥 Main: {summary['topChampions'][0]['champion']}
"""
print(display)Old (v1.0):
matches = await get_recent_matches_tool("Name", "Tag", count=5)
# Parse string output manually 😞
lines = matches.split("\n")
# Complex string parsing...New (v2.0):
matches = await lol_get_recent_matches("Name", "Tag", count=5)
# Direct access to structured data 🎉
for match in matches['recentMatches']:
print(f"{match['champion']}: {match['kda']} - {match['result']}")
print(f" CS: {match['cs']}, Gold: {match['gold']}")Old (v1.0):
players = [("Player1", "Tag1"), ("Player2", "Tag2")]
for name, tag in players:
summary = await get_player_summary(name, tag)
# String parsing to extract rank
rank_line = summary.split("\n")[2] # Fragile!
print(rank_line)New (v2.0):
players = [("Player1", "Tag1"), ("Player2", "Tag2")]
summaries = await asyncio.gather(
*[lol_get_player_summary(name, tag) for name, tag in players]
)
for summary in summaries:
rank = summary['soloRank']['tier']
print(f"{summary['gameName']}: {rank}")Old (v1.0):
# Not possible! TFT support didn't exist ❌New (v2.0):
# Now you can!
tft = await tft_get_player_summary("Name", "Tag")
print(f"TFT Rank: {tft['tftRank']['tier']}")
# Get recent matches with compositions
matches = await tft_get_recent_matches("Name", "Tag", count=10)
for match in matches['matches']:
print(f"Placement #{match['placement']}")
for trait in match['traits']:
print(f" {trait['name']}: {trait['numUnits']} units")Old (v1.0):
# Not possible! ❌New (v2.0):
# Browse ranked ladder!
ladder = await lol_get_league_entries(
tier="DIAMOND",
rank="I",
platform="na",
page=1
)
print("Top Diamond I Players:")
for player in ladder['entries'][:10]:
print(f"{player['summonerName']}: {player['lp']} LP ({player['winRate']}% WR)")# BEFORE (v1.0)
async def get_player_rank(name: str, tag: str) -> str:
summary = await get_player_summary(name, tag)
# Extract from formatted string (fragile)
lines = summary.split("\n")
rank_line = lines[2] # "🏅 Rank: ..."
return rank_line
# AFTER (v2.0)
async def get_player_rank(name: str, tag: str) -> str:
summary = await lol_get_player_summary(name, tag)
# Direct access (robust)
tier = summary['soloRank']['tier']
rank = summary['soloRank']['rank']
return f"{tier} {rank}"# BEFORE (v1.0)
async def analyze_champions(name: str, tag: str):
champs_str = await get_top_champions_tool(name, tag, count=5)
# Manual parsing: "- Amumu: Level 39, 485781 pts"
lines = champs_str.split("\n")
for line in lines:
parts = line.split(": ")
champ_info = parts[1].split(", ")
# Complex string manipulation...
# AFTER (v2.0)
async def analyze_champions(name: str, tag: str):
result = await lol_get_top_champions(name, tag, count=5)
# Direct access to structured data
for champ in result['topChampions']:
print(f"{champ['champion']}: Level {champ['level']}, {champ['points']} pts")
# Simple and clear# BEFORE (v1.0)
async def get_match_info(match_id: str, puuid: str):
details = await get_match_summary(match_id, puuid)
# Details already a dict, but limited fields
return {
"kda": details.get("kda"),
"damage": details.get("totalDamageDealtToChampions"),
}
# AFTER (v2.0)
async def get_match_info(match_id: str, puuid: str):
details = await lol_get_match_details(match_id, puuid)
# Enriched with calculated metrics
return {
"kda": details["kda"]["ratio"],
"csPerMinute": details["cs"]["csPerMinute"],
"visionScore": details["vision"]["visionScore"],
"damageDealtChamps": details["damage"]["totalDamageDealtToChampions"],
"damagePerMinute": (
details["damage"]["totalDamageDealtToChampions"] /
(details["gameDuration"]["minutes"] or 1)
),
}- Read this entire guide
- Review TOOLS_REFERENCE.md for new tool signatures
- Check EXAMPLES.md for code patterns
- Backup your current code
- Make sure you understand your current usage
- Update one tool at a time
- Test each change thoroughly
- Run all existing tests
- Update comments/docstrings
- Verify output format changes
- All tests pass
- No performance regressions
- Documentation updated
- Team aware of changes
- Can roll back if needed
Important: There are NO breaking changes. All existing code continues to work.
get_player_summary()- Works identicallyget_top_champions_tool()- Works identicallyget_recent_matches_tool()- Works identicallyget_champion_mastery_tool()- Works identicallyget_match_summary()- Works identically
- 10 new
lol_get_*tools (structured JSON responses) - 2 new
tft_get_*tools (TFT support) - Additional capabilities (ladder, spectator, challenges)
v1.0 and v2.0 can coexist:
# v1.0 compatibility layer (still works)
summary_string = await get_player_summary("Name", "Tag")
# v2.0 new tools (added in parallel)
summary_json = await lol_get_player_summary("Name", "Tag")
# Both work simultaneously!- Basic stats: ~500ms
- Recent matches: ~1-2 seconds
- Identical for existing tools (backward compatible)
- New tools: ~200-500ms (efficient implementation)
- TFT tools: ~500-1000ms (new feature)
# Use async/await for concurrent requests
summaries = await asyncio.gather(
lol_get_player_summary("Player1", "Tag1"),
lol_get_player_summary("Player2", "Tag2"),
lol_get_player_summary("Player3", "Tag3"),
)
# Fetches all 3 concurrently, ~1 second total instead of 3 seconds- Start with TOOLS_REFERENCE.md
- Review relevant examples in EXAMPLES.md
- Try one new tool at a time
- Compare old vs new in your own code
- This file (migration guide) ← You are here
- TOOLS_REFERENCE.md (quick reference)
- EXAMPLES.md (copy-paste ready code)
- ARCHITECTURE.md (how it works internally)
A: No. All existing tools work identically.
A: Not required, but recommended for new code. New tools provide better data access and new features.
A: Yes! Mix and match as needed during migration.
A: v2.0 has improved error handling, but old tools maintain same behavior.
A: No significant difference. Both are fast (~200-1000ms per request).
A: You can't accidentally break anything. Your old code still works.
A: Completely new - not in v1.0. No migration needed, just add new features.
- Continue using existing tools
- Your code works unchanged
- No action required
- Read EXAMPLES.md
- Start with one new tool
- Integrate into your workflow
- Migrate at your own pace
- Use new
lol_get_*andtft_get_*tools - These weren't available in v1.0
- Add to existing codebase alongside old tools
async def report_player_stats(name: str, tag: str):
summary = await get_player_summary(name, tag)
champions = await get_top_champions_tool(name, tag, count=5)
matches = await get_recent_matches_tool(name, tag, count=10)
# Complex string parsing
print(summary)
print(champions)
print(matches)async def report_player_stats(name: str, tag: str):
summary = await lol_get_player_summary(name, tag)
champions = await lol_get_top_champions(name, tag, count=5)
matches = await lol_get_recent_matches(name, tag, count=10)
# Clean structured data access
print(f"Level: {summary['level']}")
print(f"Rank: {summary['soloRank']['tier']}")
print(f"Main: {champions['topChampions'][0]['champion']}")
print(f"Recent WR: {sum(1 for m in matches['recentMatches'] if m['result'] == 'Win')} / 10")
# NEW: Add TFT stats (wasn't possible before)
tft = await tft_get_player_summary(name, tag)
print(f"TFT Rank: {tft['tftRank']['tier']}")- ✅ All new tests pass
- ✅ Performance acceptable (~200-1000ms per request)
- ✅ Error handling robust
- ✅ Team familiar with new tools
- ✅ Documentation updated
- ✅ Future features easier to add
- Check TROUBLESHOOTING.md (next document)
- Review EXAMPLES.md for similar patterns
- Check TOOLS_REFERENCE.md for tool signatures
- Verify API key and region settings
Last Updated: 2025-01-02
Version: 2.0.0
Migration Difficulty: ⭐ Easy (optional, fully backward compatible)