Skip to main content
Glama

wallet_get_transaction_count

Retrieve the total number of transactions sent from your Ethereum or EVM-compatible account, including the nonce, to track transaction history and ensure proper transaction sequencing.

Instructions

Get the number of transactions sent from this account (nonce)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockTagNoOptional block tag (latest, pending, etc.)
walletNoThe wallet (private key, mnemonic, or JSON). If not provided, uses PRIVATE_KEY environment variable if set.

Implementation Reference

  • The main handler function that executes the wallet_get_transaction_count tool. It retrieves the wallet instance, checks for a provider, calls wallet.getTransactionCount(blockTag), and returns the result or error.
    export const getTransactionCountHandler = async (input: any): Promise<ToolResultSchema> => { try { const wallet = await getWallet(input.wallet, input.password); if (!wallet.provider) { return createErrorResponse("Provider is required to get transaction count, please set the provider URL"); } const transactionCount = await wallet.getTransactionCount(input.blockTag); return createSuccessResponse( `Transaction count retrieved successfully Transaction count: ${transactionCount.toString()} `); } catch (error) { return createErrorResponse(`Failed to get transaction count: ${(error as Error).message}`); } };
  • Defines the tool name, description, and input schema (wallet and optional blockTag) for wallet_get_transaction_count.
    { name: "wallet_get_transaction_count", description: "Get the number of transactions sent from this account (nonce)", inputSchema: { type: "object", properties: { wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON). If not provided, uses PRIVATE_KEY environment variable if set." }, blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" } }, required: [] } },
  • src/tools.ts:575-575 (registration)
    Maps the tool name 'wallet_get_transaction_count' to its handler function getTransactionCountHandler in the central handlers dictionary.
    "wallet_get_transaction_count": getTransactionCountHandler,
  • src/tools.ts:13-13 (registration)
    Imports the getTransactionCountHandler from './handlers/wallet.js' for use in tools.ts.
    getTransactionCountHandler,

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/dcSpark/mcp-cryptowallet-evm'

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