Skip to main content
Glama

filter_collection

Filter your enriched Lorcana collection CSV by format legality to see which owned cards are playable, grouped by ink color.

Instructions

Filter an enriched collection CSV down to the cards you own that are legal in a specific play format — answers "which of my cards can I actually play in format X", grouped by ink color with owned quantities.

Legality data comes from a live duels.ink fetch, which tracks Core EN, Infinity, Core ZH, and Core JA rotation. Poorcana (Common/Uncommon only, 50-card min) is the one exception: it's derived purely from the CSV's own Rarity column, no external lookup, so it still works offline and always reflects the CSV's rarity data exactly.

Behavior: promo rows (Set Name == "Disney Lorcana Promo Cards") are always excluded from Core/Infinity/regional results, not flagged as illegal — duels.ink's legality table is keyed by (set, number) and promos don't map onto that cleanly (see "Promo cards" in the reference doc). Any other row duels.ink doesn't recognize (usually a card from a set duels.ink hasn't indexed yet) is silently skipped and counted in a "rows skipped" footer — that's a data-lag note, not a legality verdict, so don't read a skipped row as "illegal". Requires the enriched CSV's columns (Set Name, Number, Ink, Ink Cost, Add to Quantity, etc.) — running this against the raw TCGPlayer export (pre-enrich_csv) will silently undercount or return nothing useful.

Usage guidelines: run this when you want to see your full legal card pool for a format before hand-building a deck, or to sanity-check whether a deck idea is even feasible with what you own. If you want a finished decklist rather than just the eligible pool, use build_deck with mode="collection" instead — it already applies this same legality filter internally as part of assembling a curve-balanced list, so you don't need to call both.

Args: csv_path: Absolute path to an enriched Lorcana collection CSV. format: "core", "infinity", "core_zh", "core_ja", or "poorcana".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNocore
csv_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.7

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden and does so richly: live duels.ink fetch, Poorcana being offline/CSV-derived, promo-row exclusion semantics (excluded, not illegal), skipped rows being a data-lag note rather than a legality verdict, and the hard dependency on enrich_csv output columns. This is exactly the behavioral context an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and output shape are front-loaded, and every subsequent sentence carries distinct information (offline exception, promo handling, skipped-row caveat, dependency, alternative tool). It is longer than typical and slightly dense, but there is little waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need no explanation; the description instead covers inputs, offline/online behavior, edge-case row handling, upstream dependency, and the sibling alternative. Nothing needed to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it largely does: csv_path is defined as an absolute path to an enriched Lorcana CSV (with a warning about raw exports), and the valid format values are enumerated in prose despite the schema lacking an enum. It omits that format defaults to 'core', which the schema only implies via a bare default value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (filter), resource (enriched collection CSV), scope (cards you own legal in format X), and output shape (grouped by ink color with owned quantities). An agent can tell it apart from build_deck and enrich_csv without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('before hand-building a deck', 'sanity-check whether a deck idea is feasible') and an explicit when-not with the named alternative: use build_deck with mode="collection" instead, which already applies this filter internally. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.