getTransactionCount
Retrieve the total number of transactions sent from a specific Ethereum address using this tool. Ideal for analyzing wallet activity and transaction history on the Ethereum blockchain.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes |
Implementation Reference
- tools/balance.js:31-43 (handler)Handler function that fetches the transaction count (nonce) for the given Ethereum address using web3.eth.getTransactionCount and returns it in the MCP response format.async ({ address }) => { try { const transactionCount = await web3.eth.getTransactionCount(address); return { content: [{ type: "text", text: `Transaction count (nonce) for ${address}: ${transactionCount}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error fetching transaction count: ${error.message}` }] }; } } );
- tools/balance.js:30-30 (schema)Input schema using Zod to validate the Ethereum address parameter.{ address: z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address") },
- tools/balance.js:29-29 (registration)Registration of the getTransactionCount tool on the MCP server.server.tool("getTransactionCount",