Skip to main content
Glama

Find substitutes

find_substitutes
Read-onlyIdempotent

Cards that could replace a target card, two ways. similar: the cards whose rules text is nearest the target's (precomputed over the whole catalogue, best first: nearest by text, with a nearer mana value, a more played card and one whose effects point at the same side ahead; similarity 0–1 is the text closeness alone, not a verdict), fitted to the deck when given — its colour identity (both commanders of a pair, else the target's), legal in its format, not already in it — as owned (the user's cards with free copies) and to_buy (cheapest priced printing in currency, null when none is priced; owned_claimed = copies the user owns that the decks in claimed_by claim in full: name them). Nearness is in the words, not in how a card plays with the deck: YOU judge which do the job, and say so. similar.known false means no list exists for the card yet. candidates: owned cards passing mechanical filters only (a shared primary type, cmc within cmc_window, default ±2, ignored for lands; optional price_ceiling per copy; with a deck, legal in its format). Both lists leave out a banned card, and a restricted one unless the row holds a single copy, since a swap keeps the row's count. Disclose free vs. claimed counts, say proxies beside a card that has any, and name every deck in shared_with. A card to buy with no price yet gets one from the nightly price refresh (price_queued is always false: this tool queues nothing). To make the swap, call replace_card with the row's want_id. Read-only: it changes nothing and starts no work; a target named by a name newer than the catalogue is looked up on Scryfall. Not on every plan: a PLAN_LIMIT answer says so.

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": {
      "target": "<target>"
    },
    "name": "find_substitutes"
  }
}

Input Schema

NameRequiredDescriptionDefault
deckNoDeck context (id or name)
limitNo
targetYesThe card to replace
currencyNoDisplay currency. USD/EUR come from Scryfall; CHF is always EUR × the stored ECB rate. A response that carries `rate_missing` could not price in CHF at all: tell the user that, not that the cards have no price.
cmc_windowNo
price_ceilingNo

Output Schema

NameRequiredDescriptionDefault
noteYes
targetYes
similarYes
candidatesYesOwned cards passing mechanical filters only: judge functional similarity yourself
constraintsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, openWorld, non-destructive), and the description still adds real behaviour: banned cards excluded, restricted cards only when the row holds a single copy and why (a swap keeps the count), unknown names resolved via Scryfall, and the price-refresh path. It also prescribes agent conduct — disclose free vs claimed counts, name `proxies`, name every deck in `shared_with` — which is not visible anywhere in the annotations.

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?

It is front-loaded — the two modes are named in the first clause and each gets its own sentence — and there is no filler sentence. It is, however, a single dense paragraph with heavy backtick notation, so long parentheticals like the `owned_claimed` clause take effort to parse on a first read.

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?

This is a high-complexity tool with nested target params, an output schema, and two retrieval modes, and the description still covers mode selection, filtering rules, edge cases (`similar.known` false, unpriced cards), and the required agent-side disclosure. An agent has everything needed to call it and to report results correctly.

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 50%, and the description compensates well for the undocumented properties: `cmc_window` gets a default (±2) and a lands exemption, `price_ceiling` is scoped per copy, `deck` is explained as colour-identity/format/ownership fitting, and `currency` picks up the `rate_missing` caveat. Only `limit` goes entirely unexplained in both the schema and the description.

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?

"Cards that could replace a target card, two ways" names the resource (replacement cards) and immediately splits it into the two distinct retrieval strategies, `similar` (text nearness over the catalogue) and `candidates` (owned cards passing mechanical filters). The distinction from replace_card is explicit, so an agent can pick the right tool without opening a 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?

It states the condition that selects each mode: `similar` for text-nearness ranked best-first, `candidates` for owned cards passing mechanical filters. It also names the follow-on action ("To make the swap, call replace_card with the row's want_id") and the failure mode "a PLAN_LIMIT answer says so", so the agent knows the alternative route and the plan gate.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources