Skip to main content
Glama

filter_collection

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.

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. Illumineer's Quest player-deck reprints take the legality of the regular printing with the same name. Quest-only Illumineer's Quest cards (scenario deck, tokens) are excluded from every format, Poorcana included. Promos are skipped because 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".

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "csv_path": "<csv_path>"
    },
    "name": "filter_collection"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNocore
csv_pathYes

Output 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?

With no annotations supplied, the description carries the full behavioral burden and does so thoroughly: promo rows are excluded rather than flagged illegal, Illumineer's Quest reprints inherit legality of the regular printing, Quest-only cards are excluded from all formats, unrecognized rows are silently skipped and counted in a footer, and a skipped row is explicitly not an illegality verdict. It also discloses the live duels.ink dependency and that Poorcana works offline from the CSV Rarity column.

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?

Content is front-loaded (purpose sentence, then behavior, then usage) and every section carries information. There is some redundancy, notably the parenthetical re-explanation of why promos are skipped after the exclusion was already stated, and the trailing Args block partially restates prose above, but it is the only place the exact enum strings appear.

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?

For a two-parameter tool with a query-oriented output schema, the description covers inputs, source-of-truth behavior, edge cases (promos, reprints, unrecognized rows), and the pre-enrichment failure mode. Nothing an agent needs to call this correctly or interpret results appears to be 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 described as an absolute path to an enriched collection CSV, and the Args block enumerates the five valid format strings that the schema does not constrain with an enum. It does not state that format defaults to 'core', a minor remaining gap.

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 and resource ('filter an enriched collection CSV down to the cards you own that are legal in a specific play format') and includes the user-facing question it answers. It is clearly distinguishable from siblings like build_deck and enrich_csv by naming what it does and does not do.

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?

Explicitly says when to run it ('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') and when to use an alternative instead ('if you want a finished decklist... use build_deck with mode="collection"... so you don't need to call both'). It also states the prerequisite that the CSV must already be enriched.

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