Skip to main content
Glama

transfer_erc1155

Facilitates the transfer of ERC1155 tokens between addresses across Ethereum-compatible networks. Specify token details, recipient, and network to execute secure, multi-token transactions.

Instructions

Transfer ERC1155 tokens to another address. ERC1155 is a multi-token standard that can represent both fungible and non-fungible tokens in a single contract.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesThe quantity of tokens to send (e.g., '1' for a single NFT or '10' for 10 fungible tokens)
networkNoNetwork name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. ERC1155 tokens exist across many networks. Defaults to Ethereum mainnet.
privateKeyYesPrivate key of the token owner account in hex format (with or without 0x prefix). SECURITY: This is used only for transaction signing and is not stored.
toAddressYesThe recipient wallet address that will receive the tokens
tokenAddressYesThe contract address of the ERC1155 token collection (e.g., '0x76BE3b62873462d2142405439777e971754E8E77')
tokenIdYesThe ID of the specific token to transfer (e.g., '1234')

Implementation Reference

  • The main handler function for transferring ERC1155 tokens. It resolves addresses, prepares the wallet client, and executes safeTransferFrom on the contract.
    export async function transferERC1155(
      tokenAddressOrEns: string,
      toAddressOrEns: string,
      tokenId: bigint,
      amount: string,
      privateKey: string | `0x${string}`,
      network: string = 'ethereum'
    ): Promise<{
      txHash: Hash;
      tokenId: string;
      amount: string;
    }> {
      // Resolve ENS names to addresses if needed
      const tokenAddress = await resolveAddress(tokenAddressOrEns, network) as Address;
      const toAddress = await resolveAddress(toAddressOrEns, network) as Address;
      
      // Ensure the private key has 0x prefix
      const formattedKey = typeof privateKey === 'string' && !privateKey.startsWith('0x')
        ? `0x${privateKey}` as `0x${string}`
        : privateKey as `0x${string}`;
      
      // Create wallet client for sending the transaction
      const walletClient = getWalletClient(formattedKey, network);
      const fromAddress = walletClient.account!.address;
      
      // Parse amount to bigint
      const amountBigInt = BigInt(amount);
      
      // Send the transaction
      const hash = await walletClient.writeContract({
        address: tokenAddress,
        abi: erc1155TransferAbi,
        functionName: 'safeTransferFrom',
        args: [fromAddress, toAddress, tokenId, amountBigInt, '0x'],
        account: walletClient.account!,
        chain: walletClient.chain
      });
      
      return {
        txHash: hash,
        tokenId: tokenId.toString(),
        amount
      };
    } 
  • ABI fragment for ERC1155 safeTransferFrom and balanceOf functions used in the transfer handler.
    const erc1155TransferAbi = [
      {
        inputs: [
          { type: 'address', name: 'from' },
          { type: 'address', name: 'to' },
          { type: 'uint256', name: 'id' },
          { type: 'uint256', name: 'amount' },
          { type: 'bytes', name: 'data' }
        ],
        name: 'safeTransferFrom',
        outputs: [],
        stateMutability: 'nonpayable',
        type: 'function'
      },
      {
        inputs: [
          { type: 'address', name: 'account' },
          { type: 'uint256', name: 'id' }
        ],
        name: 'balanceOf',
        outputs: [{ type: 'uint256' }],
        stateMutability: 'view',
        type: 'function'
      }
    ] as const;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states what the tool does at a high level. It doesn't disclose critical behavioral traits like transaction costs, gas requirements, confirmation times, error conditions, or what happens on failure. The description mentions ERC1155 characteristics but not tool-specific behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences. The first sentence states the core purpose, and the second provides helpful context about ERC1155. No wasted words, though it could be slightly more front-loaded with critical behavioral information given the lack of annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex transaction tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, gas implications, or security considerations beyond what's in parameter descriptions. The ERC1155 context is helpful but doesn't compensate for missing behavioral transparency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema descriptions. The baseline score of 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Transfer') and resource ('ERC1155 tokens to another address'), with additional context about ERC1155 being a multi-token standard. It distinguishes from sibling tools like transfer_erc20, transfer_eth, and transfer_nft by specifying the exact token standard.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through the ERC1155 explanation, but doesn't explicitly state when to use this tool versus alternatives like transfer_erc20 or transfer_nft. No explicit exclusions or prerequisites are mentioned, though the parameter descriptions provide some implicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcpdotdirect/evm-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server