lichess_import_pgn
Import any chess game from a PGN string and analyze each move with Stockfish, receiving evaluations and error classifications for later review.
Instructions
Import and analyze a chess game from a PGN string.
Parses any PGN (lichess, chess.com, GM games, custom PGN) through the same
Stockfish pipeline used for online games. Returns per-move evaluation,
classification (blunder/mistake/inaccuracy/good/best), and phase detection.
Results are stored in L2 Resources for later retrieval.
Use this to:
- Analyze your own games from any platform
- Import GM games and compare against your patterns (via lichess_match_patterns)
- Analyze opponent games you have PGN for
- Build a custom game library from PGN files
Args:
pgn: Full PGN string of the game (including headers)
color: Your color ('white' or 'black', default 'white')
depth: Stockfish analysis depth (8-24, default 14)
game_id: Optional game identifier (auto-detected from PGN Site header if empty)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pgn | Yes | ||
| color | No | white | |
| depth | No | ||
| game_id | No |