transfer_tokens
Facilitates secure token transfers between wallets using input parameters for sender, recipient, token details, and amount. Returns confirmation responses for each transfer.
Instructions
Transfer tokens from one wallet to another.
Expects a TransferTokensRequestContainer, returns a list of TransferTokenResponse.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transfer_tokens_requests | Yes |
Implementation Reference
- armor_crypto_mcp/armor_mcp.py:402-416 (handler)MCP tool handler decorated with @mcp.tool() that implements the transfer_tokens tool by calling the armor_client.transfer_tokens method.@mcp.tool() async def transfer_tokens(transfer_tokens_requests: TransferTokensRequestContainer) -> List[TransferTokenResponse]: """ Transfer tokens from one wallet to another. Expects a TransferTokensRequestContainer, returns a list of TransferTokenResponse. """ if not armor_client: return [{"error": "Not logged in"}] try: result: List[TransferTokenResponse] = await armor_client.transfer_tokens(transfer_tokens_requests) return result except Exception as e: return [{"error": str(e)}]
- Pydantic schema for individual TransferTokensRequest defining input parameters.class TransferTokensRequest(BaseModel): from_wallet: str = Field(description="name of the wallet to transfer tokens from") to_wallet_address: str = Field(description="public address of the wallet to transfer tokens to. Use `get_user_wallets_and_group_list` if you only have a wallet name") token: str = Field(description="public contract address of the token to transfer. To get the address from a token symbol use `get_token_details`") amount: float = Field(description="amount of tokens to transfer")
- Container schema for list of TransferTokensRequest used as input to the tool.class TransferTokensRequestContainer(BaseModel): transfer_tokens_requests: List[TransferTokensRequest]
- Pydantic schema for TransferTokenResponse defining output structure.class TransferTokenResponse(BaseModel): amount: float = Field(description="amount of tokens transferred") from_wallet_address: str = Field(description="public address of the wallet tokens were transferred from") to_wallet_address: str = Field(description="public address of the wallet tokens were transferred to") token_address: str = Field(description="public address of the token transferred") transaction_url: str = Field(description="public url of the transaction") message: str = Field(description="message of the operation showing if tokens were transferred")
- Helper method in ArmorWalletAPIClient that performs the actual API call to transfer tokens.async def transfer_tokens(self, data: TransferTokensRequestContainer) -> List[TransferTokenResponse]: """Transfer tokens from one wallet to another.""" # payload = [v.model_dump() for v in data.transfer_tokens_requests] payload = data.model_dump(exclude_none=True)['transfer_tokens_requests'] return await self._api_call("POST", "transfers/transfer/", payload)