Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/core/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,10 @@ export function registerEVMTools(server: McpServer) {
abi: z.array(z.any()).describe("The ABI (Application Binary Interface) of the smart contract function, as a JSON array"),
functionName: z.string().describe("The name of the function to call on the contract (e.g., 'transfer')"),
args: z.array(z.any()).describe("The arguments to pass to the function, as an array (e.g., ['0x1234...', '1000000000000000000'])"),
value: z.string().optional().describe("The amount of native token (in wei) to send with the transaction"),
network: z.string().optional().describe("Network name (e.g., 'sei', 'sei-testnet', 'sei-devnet') or chain ID. Defaults to Sei mainnet.")
},
async ({ contractAddress, abi, functionName, args, network = DEFAULT_NETWORK }) => {
async ({ contractAddress, abi, functionName, args, value, network = DEFAULT_NETWORK }) => {
try {
// Parse ABI if it's a string
const parsedAbi = typeof abi === 'string' ? JSON.parse(abi) : abi;
Expand All @@ -701,6 +702,10 @@ export function registerEVMTools(server: McpServer) {
args
};

if (value) {
contractParams.value = BigInt(value); // ensure it's bigint
}

const txHash = await services.writeContract(
contractParams,
network
Expand Down