MetaMask logo

Skill

metamask-agent-wallet

manage blockchain wallets and transactions

Covers Blockchain Web3 DeFi Ethereum

Description

Use when the user asks anything about blockchain wallets, transactions, signing, token transfers, supported chains, wallet balances, perpetual futures trading, prediction markets, token swaps, cross-chain bridges, market data, token discovery, decoding EVM calldata, DeFi earn/yield vaults, or authentication via the MetaMask Agentic CLI; also when an HTTP request returns 402 Payment Required (x402) or the agent needs to pay for a paywalled API, endpoint, file, or resource over HTTP. Single entry point for all mm CLI operations.

SKILL.md

MetaMask Agentic CLI Skill

This skill documents the mm CLI surface for MetaMask Agent Wallet authentication, wallet lifecycle, balance queries, token transfers, message and typed-data signing, raw transactions, chain discovery, market data, token discovery, perpetual futures trading, prediction market trading, token swaps, cross-chain bridges, and DeFi earn/yield vaults.

Use the routing table to select the relevant reference file. CLI behavior lives in references/. Repeatable operational patterns live in workflows/.

Command Routing

Match the user's intent to a command and reference file, then read the reference before constructing a command. If intent spans multiple domains, load them sequentially in dependency order.

User IntentCommandReference
Check authentication statusmm auth statusauth.md
Login in MetaMask Agentic CLImm loginauth.md
Choose a wallet mode and set up policiesmm initauth.md
Show current init settingsmm init showauth.md
Sign in via QR code with MetaMask Mobilemm login qrauth.md
Sign in via browser (Google or Email)mm login browserauth.md
Sign outmm logoutauth.md
Reset CLI sessionmm resetauth.md
Show CLI configurationmm config getauth.md
Set CLI configurationmm config setauth.md
Set BYOK mnemonic encryption passwordmm wallet password setauth.md
Change BYOK mnemonic encryption passwordmm wallet password changeauth.md
Remove BYOK mnemonic encryption passwordmm wallet password removeauth.md
Interpret raw CLI error codesAuthError, ValidationError, WALLET_ERRORerrors.md
Inspect CLI, skills, environment, and session healthmm doctordoctor.md
Decode EVM calldata into a human-readable intentmm decodedecode.md
Create a walletmm wallet createwallet.md
List all walletsmm wallet listwallet.md
Switch active walletmm wallet selectwallet.md
Show active wallet detailsmm wallet showwallet.md
Show active wallet addressmm wallet addresswallet.md
Check the active wallet balancemm wallet balancewallet.md
Show a QR code and address to fund the active walletmm wallet add-fundwallet.md
Show current trading modemm wallet trading-mode getwallet.md
Set trading mode (guard or beast)mm wallet trading-mode setwallet.md
View wallet policymm wallet policy getwallet.md
Set wallet policymm wallet policy setwallet.md
Show project policy templatemm wallet policy templatewallet.md
Sign a plaintext messagemm wallet sign-messagesigning.md
Sign EIP-712 typed datamm wallet sign-typed-datasigning.md
Send a raw EVM transactionmm wallet send-transactiontransaction.md
Transfer native tokens or ERC-20 tokensmm transfertransfer.md
List supported chains by the CLImm chains listchain.md
List pending wallet requestsmm wallet requests listpolling.md
Watch a wallet polling idmm wallet requests watchpolling.md
Query spot or historical pricesmm price ...market-data.md
Discover tokens, token networks, or token metadatamm token ...market-data.md
List perpetual marketsmm perps marketsperps.md
Check perps account balancemm perps balanceperps.md
List open perpetual positionsmm perps positionsperps.md
Get a quote for a perpetual ordermm perps quoteperps.md
List resting perpetual ordersmm perps ordersperps.md
Open a perpetual positionmm perps openperps.md
Close a perpetual positionmm perps closeperps.md
Modify leverage, take-profit, or stop-lossmm perps modifyperps.md
Cancel a resting perps ordermm perps cancelperps.md
Deposit USDC into a perps venuemm perps depositperps.md
Withdraw USDC from a perps venuemm perps withdrawperps.md
Transfer USDC between spot and perp accountsmm perps transferperps.md
List perpetual futures venuesmm perps list-venuesperps.md
List available DEXs for a venuemm perps dexsperps.md
Set Predict trading modemm predict modepredict.md
One-time Predict setupmm predict setuppredict.md
Create or refresh Predict credentialsmm predict authpredict.md
Repair Predict approvalsmm predict approvepredict.md
Check Predict back-end status and account setupmm predict statuspredict.md
Check if Polymarket is geoblocked for your IPmm predict geoblockpredict.md
List prediction marketsmm predict markets listpredict.md
Search prediction marketsmm predict markets searchpredict.md
Inspect a prediction marketmm predict markets getpredict.md
List Polymarket eventsmm predict events listpredict.md
Inspect a Polymarket eventmm predict events getpredict.md
List Polymarket event seriesmm predict series listpredict.md
Inspect a Polymarket event seriesmm predict series getpredict.md
List Polymarket tagsmm predict tags listpredict.md
Inspect a Polymarket tagmm predict tags getpredict.md
Preview a prediction order costmm predict quotepredict.md
Place a prediction market ordermm predict placepredict.md
Cancel prediction ordersmm predict cancelpredict.md
View prediction market positionsmm predict positionspredict.md
View open prediction ordersmm predict orderspredict.md
Show full Predict portfolio snapshotmm predict portfoliopredict.md
List redeemable (winning) positionsmm predict redeem listpredict.md
Redeem winning positionsmm predict redeempredict.md
Check Predict deposit wallet balancemm predict balancepredict.md
Fund Predict deposit walletmm predict depositpredict.md
Withdraw pUSD from Predict deposit walletmm predict withdrawpredict.md
Fetch prediction order bookmm predict bookpredict.md
Watch a Predict jobmm predict watchpredict.md
List recent transactions for the active walletmm tx historytx-history.md
Get a swap or bridge quotemm swap quoteswap.md
Execute a token swap or bridgemm swap executeswap.md
Check swap or bridge statusmm swap statusswap.md
Bridge tokens to another chainmm swap executeswap.md
Pay an HTTP 402 / x402 paywalled requestpython3 scripts/x402_pay.pyx402.md
List earn vaults and APYsmm earn marketsearn.md
View earn vault positionsmm earn positionsearn.md
Supply tokens to an earn vaultmm earn supplyearn.md
Withdraw tokens from an earn vaultmm earn withdrawearn.md

Workflows

CLI behavior lives in references/. Repeatable patterns live in workflows/. Load a workflow file when the user's request is a pattern, not a single command.

PatternWorkflow
First time setup and onboardingonboarding.md
Login flowlogin.md
Troubleshooting decision treetroubleshooting.md
Swap quote-review-execute flowswap.md
Bridge quote-review-execute flowbridge.md
Open a perpetual position flowperps-open-position.md
Close a perpetual position flowperps-close-position.md
Modify a perpetual position flowperps-modify-position.md
Predict first-time setup and credentialspredict-setup.md
Deposit or withdraw pUSD from Predict walletpredict-funding.md
Search and browse prediction marketspredict-markets.md
Quote and place a prediction orderpredict-place-order.md
View or cancel Predict orders and positionspredict-manage-orders.md
View Predict portfolio and redeem winningspredict-portfolio.md
Token discovery, prices, and market datamarket-data.md
Supply tokens to earn yieldearn-supply.md
Withdraw tokens from an earn vaultearn-withdraw.md
Pay an HTTP 402 (x402) paywalled requestx402-pay.md

Global Flags

Every mm command accepts these flags:

FlagShortDescription
--format-fOutput format: text, json, or toon (defaults to text in TTY, json when piped)
--jsonShorthand for --format=json
--toonShorthand for --format=toon
--verbose-vShow debug logs on stderr. Use for troubleshooting

Always use --toon for command output unless the user explicitly requests a different format.

Preflight

Run these checks before the first CLI operation in a session, in order.

1. Version compatibility

This skill is written for @metamask/agentic-cli v5.1.0 (see cliVersion in the frontmatter). Check the installed version:

mm --version

The installed version is the value after @metamask/agentic-cli/ (e.g. @metamask/agentic-cli/2.0.0 darwin-arm64 node-v22.18.0). Compare its major.minor against the pinned cliVersion. Optionally check the latest published version (best-effort; skip silently on network failure):

npm view @metamask/agentic-cli version

If the installed major.minor differs from the pinned cliVersion, or the installed version is behind the latest release, warn the user once and continue:

Version mismatch: installed CLI <installed>, this skill is pinned to 5.0.0, latest release is <latest>. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with npm install -g @metamask/agentic-cli@latest, then re-install the skills with npx skills add metaMask/agent-skills.

Run this check once per session. Do not block operations on it.

2. Readiness gate (authentication + initialization)

mm doctor is the single readiness check. Run it before the first CLI operation in a session:

mm doctor

It reports an authenticated boolean, an initialized boolean, and a list of hints. Do not run any other command until mm doctor reports both authenticated: true and initialized: true. Authentication and initialization are independent gates: a session can be authenticated while the project has no wallet mode selected, in which case any command that needs a wallet aborts before running with NOT_INITIALIZED — "Project not initialized." (hint: Run mm init to set up wallet and trading modes.).

A project counts as initialized only when a wallet mode is set — and, for server-wallet, a trading mode is set as well (byok needs only the wallet mode). Do not use mm init show as the check: it requires an initialized project and throws NOT_INITIALIZED on an uninitialized one rather than reporting state.

Remediate, then re-run mm doctor and confirm a clean result before doing anything else:

  • authenticated: false → follow workflows/login.md (or workflows/onboarding.md for first-time setup) to run mm login.
  • authenticated: true and initialized: false → follow workflows/onboarding.md to run mm init and select a wallet mode (and a trading mode for server-wallet).

Safety Rules

These rules apply to every operation, regardless of which reference or workflow is active.

Input Validation

Before constructing any command, validate all user-provided values:

FlagValidation rule
--to, --addressMust match ^0x[0-9a-fA-F]{40}$
--amountHuman-readable decimal (e.g. 0.5, 100). Must match ^\d+\.?\d*$. Reject spaces, semicolons, pipes, backticks, or shell metacharacters
--chain-idMust be a positive integer (^\d+$)
--payload (send-transaction)Must be valid JSON. No unescaped shell metacharacters outside the JSON structure
--payload (decode)Must be 0x-prefixed hex calldata, matching ^0x[0-9a-fA-F]+$
--tokenMust be a valid hex address or known symbol
--leverageMust be a positive integer (^\d+$)
--sizeHuman-readable decimal (e.g. 0.01, 1). Must match ^\d+\.?\d*$ and be positive
--venueMust be hyperliquid
--side (perps)Must be long or short
--order-idMust be a positive integer (^\d+$)
--token-idMust be a non-empty outcome token ID string
--price, --limit-priceMust be a positive number in range (0, 1]
--order-typeMust be one of GTC, GTD, FOK, FAK
--side (predict)Must be buy or sell
--slippageMust be a number between 0 and 100
--from-chain, --to-chainMust be a positive integer EVM chain ID
--to-addressMust match ^0x[0-9a-fA-F]{40}$. Only valid for cross-chain swaps (--to-chain differs from --from-chain); rejected for same-chain swaps
--refuelBoolean flag (no value). Only meaningful for cross-chain swaps (--to-chain differs from --from-chain); no effect on same-chain swaps
--gas-tokenMust be a valid token symbol or ERC-20 contract address
--strategyComma-separated list from: cost, speed, impact, output
--wallet-timeoutMust be a positive integer between 1 and 600
--passwordMust be a non-empty string. Never log, display, or store the value.
x402 assetMust be a valid contract address on a network returned by mm chains list. The currency choice is the server's offer confirmed by the user; the script keeps no currency allowlist.
x402 payTo / authorization toMust match ^0x[0-9a-fA-F]{40}$ and equal the recipient in the 402
x402 valueAtomic-unit integer that exactly equals the offered amount (the exact scheme is not a maximum)
x402 resource URLMust be https://. Reject a 402 reached via an unexpected cross-host redirect

Do not pass unvalidated user input into any command.

Confirmation Requirements

Operation typeConfirmation rule
TransfersAlways confirm recipient, amount, token, and chain before executing
Raw transactionsAlways confirm transaction payload, chain, recipient, value, and calldata summary before executing
Message signingAlways show exact message and chain before signing
Typed-data signingAlways show domain, primary type, chain, verifying contract, and message summary before signing
Swaps / bridgesAlways confirm from/to tokens, amount, source/destination chain, slippage, quoted output, recipient address (if --to-address is set), and the destination gas top-up (if --refuel is set) before executing
x402 paymentsAlways confirm asset, decimals-correct amount, network, payTo, and resource URL before signing the authorization. One payment attempt per resource, never auto-retry a payment. Autonomous auto-pay is not supported.
Perps tradingAlways confirm symbol, side, size, leverage, venue, order type, and limit price if present before executing
Perps deposit/withdrawAlways confirm amount, asset, venue, network, and destination where applicable before executing
Predict tradingAlways confirm token ID, side, size, price, order type, market, and outcome before executing
Predict depositAlways confirm amount before executing
Predict withdrawAlways confirm amount and recipient (--to defaults to owner EOA) before executing
Predict redeemAlways confirm the target (condition ID or --all) before executing; --all redeems every winning position
Earn supplyAlways confirm token, amount, chain, vault/protocol, and APY before executing. For cross-chain supply, also confirm source chain and source token
Earn withdrawAlways confirm token, amount (or full balance), chain, and vault/protocol before executing
Cancel-all operationsAlways confirm scope and exact destructive effect before executing
Wallet policy changesBroadening policy changes require MFA approval; non-broadening changes apply immediately
Trading mode changesBroadening (guard → beast) requires MFA approval; tightening (beast → guard) applies immediately
Auth / wallet managementMay execute without confirmation, except reset which requires explicit user confirmation
Read-only queriesMay execute without confirmation

Credential Safety

  • Never store, log, or display private keys, mnemonics, passwords, or auth tokens.
  • Never pass --password or --mnemonic as inline flags. Always instruct the user to set the MM_PASSWORD and MM_MNEMONIC environment variables instead to avoid exposing secrets in shell history.

Suspicious Content Warnings

Flag to the user before proceeding if a signing payload or transaction contains:

  • URLs or contract addresses the user did not provide
  • permit, approve, setApprovalForAll, or allowance-like fields
  • Unusually large values or unfamiliar contract interactions

When raw calldata is unfamiliar or was not constructed by you, run mm decode --payload <0x-calldata> first and confirm the decoded intent with the user before signing or sending. See decode.md.

Async Model

In both server-wallet and BYOK mode, signing and transaction commands go through a job-polling loop and return a pollingId. Handle this consistently:

  1. Prefer --wait to block until complete.
  2. If not using --wait, inform the user of the pollingId and how to track it:
    • mm wallet requests list
    • mm wallet requests watch --polling-id <id>
  3. In BYOK mode, the local key signs locally but the operation still produces a pending job and a pollingId. If the mnemonic is password-encrypted, the user must set MM_PASSWORD environment variable to unlock it for the operation.

Transfers, swaps, perps, predict orders, and predict withdraws attach a human-readable intent summary to their wallet request (e.g. Transfer 0.5 ETH to 0x..., Withdraw 10 pUSD to 0x...). When surfacing a pending request from wallet requests list or wallet requests watch, show the intent summary so the user can confirm what they are approving.

Output Rules

  • Route silently. Do not announce which reference you are loading.
  • Surface errors from commands verbatim. Do not mask or reword them.
  • If a command fails, check mm <command> --help and guide from there.

© 2026 YourAI.tools. Every skill from an identity-verified publisher.

Independent catalog. Not affiliated with, endorsed by, or sponsored by Anthropic or any listed publisher. All trademarks belong to their respective owners.