# Drawstep engine · Statics & layers · `grantAbility` > Grant ability — e.g. “~ has "When ~ enters, (no effects)"”. 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/statics#grantAbility ## Where it goes The `effect` of a static ability (or one of its `effects`): `{ "kind": "static", "effect": { "type": "grantAbility", … } }`. Applied continuously through the layer system. Printed words that point here (search aliases): gains all abilities of has all abilities of those creatures has the abilities of. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `to` | `TargetDef` | yes | What it applies to (TargetDef) | | `ability` | `AbilityDef` | yes | The ability granted (an AbilityDef) | ## Minimal form ```json {"type":"grantAbility","to":{"of":"object","mode":"self"},"ability":{"kind":"triggered","trigger":{"event":"enters","filter":{"self":true}},"effects":[],"distinctModeTargets":"player"}} ``` The engine reads that minimal form as: “~ has "When ~ enters, (no effects)"”. ## Stock examples - **Mana Boots** — “Equipped creature has "{T}: Add {G}." Equip {1}.” ```json {"type":"grantAbility","to":{"of":"object","mode":"host"},"ability":{"kind":"activated","cost":{"tapSelf":true},"effects":[{"effect":"addMana","who":"you","mana":"{G}"}]}} ``` - **Role-Sorcerer Study** — “Create a sorcerer Role token attached to target creature.” ```json {"type":"grantAbility","to":{"of":"object","mode":"host"},"ability":{"kind":"triggered","trigger":{"event":"attacks","filter":{"self":true}},"effects":[{"effect":"scry","who":"you","amount":1}]}} ``` - **Role-Young-Hero Study** — “Create a young hero Role token attached to target creature.” ```json {"type":"grantAbility","to":{"of":"object","mode":"host"},"ability":{"kind":"triggered","trigger":{"event":"attacks","filter":{"self":true},"condition":{"kind":"compare","a":{"kind":"sourceToughness"},"op":"<=","b":3}},"effects":[{"effect":"addCounters","target":{"of":"object","mode":"self"},"counter":"+1/+1","amount":1}]}} ``` ## Related - [Statics & layers](https://drawstep.xyz/wiki/mtg/statics.md) — the whole topic - [Filters & targets](https://drawstep.xyz/wiki/mtg/targets.md) — how `target` / `filter` select objects and players (selection algebra) - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive