Skip to main content
Glama
ygo-format

ygo-format

by andrewboe

ygo-format

Format-aware Yu-Gi-Oh! card data and an MCP server, so an AI assistant can build and check decks from real data instead of memory. It knows TCG Advanced (the current Forbidden & Limited list) and Genesys (points, the 100-point cap, no Link or Pendulum Monsters).

Card text, ban status, Genesys points, legality and tournament meta all come from live sources, cached on your machine:

Source

Used for

YGOProDeck API

card text, stats, archetypes, TCG/OCG dates, Genesys points

Project Ignis LFLists

TCG F&L list (the stricter of it and YGOProDeck is used)

Yugioh Meta

recent tournament tops, deck shares, card inclusion

YGOResources

official OCG FAQ and Q&A rulings

Nothing from these sources is bundled; the server fetches and caches it on first use.

Tools

Tool

What it does

search_cards

Search the legal card pool by text, regex, name, archetype, type, attribute, level, points

card_lookup

One card: full text, stats, status in every format, alt passcodes, rulings links

archetype

An archetype's members and support cards, with limits or points

validate_deck

Legality of a deck (.ydk, ydke:// URL or plain list) with every card's status or points

finalize_deck / saved_decks

Save a deck only if it is legal (.ydk + ydke:// + text list); list saved decks

find_links

Bridges between engines: searchers into the deck, what it reaches, Extra Deck options, Special Summon locks

meta_snapshot

Recent tops for a format: deck shares, top 8s, wins, how many lists are still legal, staples

meta_inclusion

How a card is played across tops, or a deck type's card inclusion table

card_rulings

Official Q&As for a card, optionally only those involving a second card or certain words

find_lines / line_result

Optional. Engine-searched turn-1 lines for a specific 5-card hand (needs ygo-sim)

Every answer carries a data block saying when the card data was fetched and which F&L list it reflects.

The repo also ships a Claude Code skill, skills/ygo-deckbuilding, that tells the assistant how to use these tools: format first, every card fact from a tool, validate before showing a list, rulings quoted with their date, and hand lines only on request.

Related MCP server: Lorcana MCP Playtest Platform

Install

Short version (details, other MCP clients and troubleshooting in docs/INSTALL.md):

Windows (PowerShell):

git clone https://github.com/andrewboe/ygo-format.git
cd ygo-format
py -3 -m venv .venv
.venv\Scripts\python -m pip install -e .
claude mcp add --scope user ygo-format -- "$PWD\.venv\Scripts\python.exe" -m ygoformat.mcp_server

macOS / Linux:

git clone https://github.com/andrewboe/ygo-format.git
cd ygo-format
python3 -m venv .venv
.venv/bin/python -m pip install -e .
claude mcp add --scope user ygo-format -- "$PWD/.venv/bin/python" -m ygoformat.mcp_server

Then ask Claude something like "Is this Genesys list under 100 points?" or "Build me a Destiny HERO deck for TCG Advanced."

Limits

  • find_links parses card text with rules, not an engine: treat its ruling flags as unverified, and Fusion Summon spells are not modelled as links yet.

  • card_rulings returns OCG rulings; TCG rulings can differ.

  • find_lines is a search, not a solver, and is slow (about 10 s at quick depth, 1–4 min deeper).

  • Known tool problems from real use are logged in docs/format_mcp_dryrun.md.

Development

.venv/Scripts/python -m pip install -e ".[test]"
.venv/Scripts/python -m pytest

Tests run offline against pinned fixtures in tests/fixtures. Design notes: docs/format_mcp_scope.md (written while the code lived in ygo-sim, so module paths there say ygosim).

This project was split out of ygo-sim at commit 6aa4d34; ygo-sim now depends on it for card data and formats.

Licensed under the MIT License. Card data, rulings and meta are fetched from the sources above and remain theirs. Yu-Gi-Oh! is a trademark of Konami. This project is not affiliated with or endorsed by Konami.

Available Tools

12 tools
archetypeA
Read-only

An archetype's members (name contains name, case-sensitive) with status in format, plus support: cards YGOProDeck tags with it or whose text names it in quotes. Card text is included when the answer is small (<= 60 cards) unless include_text is set.

Inputs: name (required), format (required), include_text.

card_lookupA
Read-only

One card by name or passcode: full text, stats, status in every format (limit, Genesys points, legality and why not), alt passcodes, quoted names in its text, and rulings links. unresolved_mentions lists quoted names that match no card (likely data typos) with the closest names. Unknown or ambiguous names return candidates instead of a guess.

Inputs: query (required).

card_rulingsA
Read-only

Official FAQ and Q&A rulings for a card (Konami OCG database via YGOResources, cached locally). with_card: only Q&As that involve both cards (best for "does X work with Y" questions). query: only Q&As containing all these words, e.g. "cost banish" or "damage step". Each Q&A has title, question, answer, date, translation status and names_in_text; Q&As whose text names the card(s) come first, ahead of omnibus entries that only list them. With with_card, the note says when no Q&A discusses both cards (the interaction is then unverified). These are OCG rulings and TCG rulings can differ: quote them, don't extend them past what they cover. Requests are capped per call to respect YGOResources; the note says when more remain.

Inputs: card (required), limit, query, with_card.

finalize_deckA
Idempotent

Save a finished deck, but only if validate_deck says it is legal (otherwise nothing is written and the problems come back). Writes data/decks/..ydk and a .json with the ydke:// URL, a text decklist, the points or ban breakdown and the data "as of" date. Saving the same name again keeps the previous .ydk in data/decks/history/. Follow-up questions can pass the returned ydk path to validate_deck or find_links.

Inputs: name (required), format (required), notes, decklist, +3 more.

find_linesA

Find the turn-1 lines a starting hand makes, going first, by searching the real game engine (EDOPro, run in WSL): the deck is stacked so the hand is exactly these 5 cards, then turn 1 is searched several times from independent starts. Returns a job_id at once (quick ~10 s, normal ~1 min, deep ~2 min); fetch the lines with line_result. hand: 5 card names or passcodes. Deck: exactly one of saved_deck (a name from saved_decks), ydk_path, ydk_text (or ydke:// URL), decklist. executor (optional): "module:Class" of a windbot_decks executor to steer the search (e.g. "windbot_decks.mitsurugi:MitsurugiExecutor"). Lines are scored by the interruptions left live after a scripted opponent turn, plus hand traps held: a search result, not a solver; present it as "found by search" and check rulings it relies on with card_rulings. Run it when the user asks for a specific hand's line, starting with depth "quick". Optional: needs a ygo-sim checkout named by YGOSIM_HOME; without one it returns an error saying so.

Inputs: hand (required), depth, decklist, executor, +3 more.

line_resultA
Read-only

Result of a find_lines search: status running / done / failed. When done: the hand and up to one line per search start (best first), each with score, the steps in order, the end board, the hand left and the interruptions that stayed live. Cards the engine can't play (new sets without scripts) are reported.

Inputs: job_id (required).

meta_inclusionB
Read-only

How a card is played in recent tops (share of lists, average copies, by deck type), or a deck type's card inclusion table. Pass exactly one of card, deck_type (Yugioh Meta deck type name; near misses are suggested).

Inputs: format (required), card, days, limit, +1 more.

meta_snapshotB
Read-only

Recent tournament tops (Yugioh Meta) for the format: deck-type shares, top-8s and wins, how many lists are still legal under today's list or points (average points for Genesys), the cards that make the most lists illegal now (most_common_blockers), and the most-played cards. Genesys = Genesys events; Advanced = TCG lists outside Genesys and OCG.

Inputs: format (required), top, days.

saved_decksA
Read-only

Decks saved with finalize_deck, newest first: name, format, saved_at, summary, .ydk path, ydke URL.

Inputs: format.

search_cardsA
Read-only

Search the card pool. Only cards legal in format are returned unless include_illegal.

text: words that must all appear in the card text (or FTS5 syntax: "special summon" AND deck NOT banish) pattern: Python regex over card text, e.g. "Level 4 or lower .*Warrior" name: substring of the name; archetype: name contains it (case-sensitive game rule, e.g. "Destiny HERO") mentions: cards whose text names this in quotes, e.g. "HERO" or "Destiny HERO - Malicious" kind: monster, extra, main, tuner, fusion, synchro, xyz, link, ritual, pendulum, effect, normal, flip, spell, trap, quick-play, continuous spell, field, equip, ritual spell, normal trap, continuous trap, counter attribute: DARK, LIGHT, ...; race: Warrior, Spellcaster, ...; level_min/max: Level, Rank or Link rating max_points: Genesys points per copy at most this Card text is cut to 400 characters unless full_text.

Inputs: format (required), kind, name, race, +13 more.

validate_deckA
Read-only

Check a deck against a format and list every card with its ban status or Genesys points.

Give exactly one deck input: ydk_path a .ydk file path readable from Windows (WSL files: \wsl.localhost\Ubuntu-24.04\home...) ydk_text .ydk contents, or a ydke:// URL decklist {"main": [...], "extra": [...], "side": [...]} with entries like "3 Ash Blossom & Joyous Spring", "Called by the Grave x2", "Cupsy☆Yummy" or a passcode format: tcg_advanced (Forbidden & Limited list; stricter of YGOProDeck and Project Ignis) or genesys (no F&L; Link and Pendulum Monsters banned in every zone; Main+Extra+Side points must fit point_cap, default 100). as_of: YYYY-MM-DD for the release-date check (default today).

legal is true/false, or null when the input had unknown passcodes, unknown or ambiguous names, or unreadable .ydk lines: nothing is dropped or guessed, so fix parse_errors and call again. resolved_names lists names that were matched after normalizing; check them.

Inputs: format (required), as_of, decklist, ydk_path, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools target distinct operations: search_cards (pool query), card_lookup (single card), archetype (membership), validate_deck vs finalize_deck (check vs save), and find_lines/line_result (job start vs fetch). The closest pairs are meta_snapshot vs meta_inclusion (format-level vs card-level play rates) and card_lookup vs card_rulings (stats vs FAQ), but descriptions clearly differentiate them.

    Naming Consistency4/5

    Names are uniformly snake_case and mostly two-token, making them readable and predictable. However the verb pattern is not fully consistent: some are verb_noun (search_cards, find_links, validate_deck), while others are noun-ish or inverted (archetype, saved_decks, line_result, card_lookup).

    Tool Count5/5

    12 tools sit comfortably in the ideal range and each maps to a distinct piece of the deck-building workflow (search, lookup, rulings, meta, validate, save, links, simulation). No obvious redundant or filler tools.

    Completeness4/5

    The surface covers a full loop: search pool, inspect cards, check rulings/meta, validate a deck, save it, list saved decks, find bridges, and simulate lines. Minor gaps remain, such as no delete/rename for saved decks and no explicit format-listing tool, but core workflows have no dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Provides Magic: The Gathering card, deck, provider, and statistical evidence tools for LLMs to make informed deckbuilding decisions.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to play Disney Lorcana TCG matches over MCP, with tools for card search, deck validation, match creation, state observation, legal actions, and moves. Supports AI-vs-AI play and a live spectator board.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides access to TCGplayer trading card data, including search, product details, pricing, and market information, enabling natural language queries for card analysis.
      1
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables assistants to search and look up Riftbound TCG cards, list sets, and search or fetch public decklists (resolving stored card UUIDs into real card names) through the community card database's API, so questions about cards absent from model training data can be answered with real data.
      5
      MIT