# wallet_sweepBsv21

Sweep BSV21 tokens from an external WIF private key into the wallet

## Result

An MCP result containing the operation outcome as text, with structured content where supplied. Check isError before using it; an output schema is shown when registered.

## Permissions

This operation can change wallet, account or service state. A connected wallet applies its own permissions. Guarded broadcasts also require broadcasting to be enabled; service authorization is separate from wallet approval.

## Definition 1 (full)

Registered in: Legacy local wallet; Legacy local identity; Local Vault · broadcasting disabled; Local Vault · all roles; External BRC-100 wallet; Local Vault + sponsor.

Sweep BSV21 tokens from an external WIF private key into the wallet

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| inputs | array of object | Yes | Token UTXOs to sweep (must all be same tokenId) |  |
| inputs[].outpoint | string | Yes | Outpoint (txid_vout) |  |
| inputs[].satoshis | integer | Yes | Satoshis (should be 1) | minimum: -9007199254740991; maximum: 9007199254740991 |
| inputs[].lockingScript | string | Yes | Locking script hex |  |
| inputs[].tokenId | string | Yes | Token ID (txid_vout format) |  |
| inputs[].amount | string | Yes | Token amount as string |  |
| wif | string | Yes | WIF private key controlling the inputs |  |

Nested requirements apply when their parent is supplied.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "inputs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "outpoint": {
            "type": "string",
            "description": "Outpoint (txid_vout)"
          },
          "satoshis": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Satoshis (should be 1)"
          },
          "lockingScript": {
            "type": "string",
            "description": "Locking script hex"
          },
          "tokenId": {
            "type": "string",
            "description": "Token ID (txid_vout format)"
          },
          "amount": {
            "type": "string",
            "description": "Token amount as string"
          }
        },
        "required": [
          "outpoint",
          "satoshis",
          "lockingScript",
          "tokenId",
          "amount"
        ]
      },
      "description": "Token UTXOs to sweep (must all be same tokenId)"
    },
    "wif": {
      "type": "string",
      "description": "WIF private key controlling the inputs"
    }
  },
  "required": [
    "inputs",
    "wif"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```

[All tools](https://bsvmcp.com/docs/tools)