# Drawstep engine · Triggers · `castSpell` > Cast spell — A player cast a spell (`by`, `filter`, `from` / `notFrom`). Engine: Magic: The Gathering (`mtg`). This is one primitive of the Drawstep card vocabulary; field names and the discriminator are exact. Wiki page: https://drawstep.xyz/wiki/mtg/triggers#castSpell ## Where it goes The `trigger` of a triggered ability: `{ "kind": "triggered", "trigger": { "event": "castSpell", … }, "effects": [ … ] }`. The common trigger fields (`filter`, `by`, `other`, `condition`, `damageKind`, `oneOrMore` …) are on the triggers page. Printed words that point here (search aliases): whenever you cast a spell when you cast this spell whenever an opponent casts a spell with mana value, power, or toughness equal to the chosen number. ## Fields No fields besides the discriminator. ## Stock examples - **Iteration 71 X value** — “” ```json {"event":"castSpell","by":"you","filter":{"manaCostContains":"X"}} ``` - **Iteration 71 x** — “” ```json {"event":"castSpell","by":"you","filter":{"manaCostContains":"X"}} ``` - **Iteration 71 adventure** — “” ```json {"event":"castSpell","by":"you","filter":{"types":["Creature"],"hasAdventure":true}} ``` ## Related - [Triggers](https://drawstep.xyz/wiki/mtg/triggers.md) — the whole topic - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive