EVM code
evm_codeUse when you need to know whether an address is a contract on Base, Ethereum, Arbitrum, Polygon or Optimism: is_contract, bytecode size, sha256 of the bytecode. Returns the paid x402 request for your input (GET /evm/code, $0.002 per call; schema linked). Call that URL with an x402 or MPP client to get the data. Bad input is refused before any charge. Contract check with bytecode size and hash only; for the coin balance use evm_native_balance, for the transaction count use evm_nonce. First call each day returns the data itself, free; later calls return the paid request.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"address": "<address>"
},
"name": "evm_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Chain; default base | base |
| address | Yes | Address to test for contract code (0x + 40 hex); a plain account returns is_contract=false |