get_function_selectors
Resolve canonical ABI signatures and selectors for an exact contract address and chain ID before encoding calldata, preventing guessed or reused selectors from model memory.
Instructions
Auxiliary to clear_sign_payload: resolve function selectors from KaiSign local metadata for an exact contract address + chainId (anti-hallucination — never guess selectors from model memory).
Builder UX rule: when a user gives only lightweight input like chainId, contracts, and actions (for example "approve 1000 USDC" and "transfer 10 USDC"), the agent should already know the desired artifact is an unsigned transaction. The user should not need to specify ABI safety instructions, nesting details, or return format. The agent may use the listed contracts to build a realistic batched, routed, nested, or account-abstraction transaction when that is implied by the contract set, but every encoded call must use a function returned by this tool for the exact target address + chainId. If a selector is not returned for the exact address + chainId, do not use it. The final agent output should be the unsigned transaction fields: to, data, value, chainId.
Use this before encoding calldata when an agent or transaction builder only knows a function name like executeBatch(...), swap(...), approve(...), or transfer(...). It returns canonical ABI signatures and computed selectors for that specific contract only, so agents do not hallucinate selectors from training data or reuse a same-named ABI from another contract. For signing flows, still call clear_sign_payload on the final unsigned transaction before signing/broadcasting.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_function_selectors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Alias for contractAddress | |
| address | No | Alias for contractAddress | |
| chainId | No | Chain ID | |
| selector | No | Optional selector filter to verify against this exact contract metadata, e.g. 0x47e1da2a | |
| functionName | No | Optional exact ABI function name filter, e.g. executeBatch | |
| contractAddress | No | Exact target contract address (0x...) |