# set-mechanism-count (/docs/tx/set-mechanism-count)

Mechanisms are independent incentive sub-markets within one subnet, each
running its own weights and consensus; this owner-only call sets how many
the subnet runs. The count must be greater than zero, and the chain caps
how many mechanisms a subnet may have. Increasing the count opens new
mechanisms; decreasing it removes the highest-numbered ones and the
miner state in them. Any change to the count clears the emission split
back to an even division — reapply `set_mechanism_emission_split`
afterwards if you want an uneven split. Rate-limited and blocked during
the end-of-epoch admin freeze window.

| Signer    | Pallet     | Wraps                                 |
| --------- | ---------- | ------------------------------------- |
| `coldkey` | AdminUtils | `AdminUtils.sudo_set_mechanism_count` |

## Parameters [#parameters]

| Parameter         | Type    | Required | Description                                        |
| ----------------- | ------- | -------- | -------------------------------------------------- |
| `netuid`          | integer | yes      | Subnet to configure; the signer must be its owner. |
| `mechanism_count` | integer | yes      | Number of mechanisms the subnet should run.        |

Address parameters (`--hotkey`, `--coldkey`, `--dest`, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.

## CLI [#cli]

Preview with `--dry-run` (shows fee, effects, and policy result without
submitting), then submit:

```bash
btcli tx set-mechanism-count \
  --netuid <int> \
  --mechanism-count <int> --dry-run
btcli tx set-mechanism-count \
  --netuid <int> \
  --mechanism-count <int> -w my_coldkey
```

## Python [#python]

```python
import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.SetMechanismCount(netuid=1, mechanism_count=0)

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)
```

Or build it by op name, as an agent would:

```python
await client.execute_tool("set_mechanism_count", {...}, wallet)
```
