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,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get'), implying it's non-destructive, but doesn't cover other aspects like authentication needs (e.g., wallet parameter handling), rate limits, error conditions, or what the return value represents (e.g., integer count). This leaves gaps for safe and effective use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It directly addresses what the tool does, making it easy to parse quickly. Every part of the sentence earns its place by specifying the action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that retrieves dynamic data. It lacks details on return format (e.g., integer nonce), error handling, dependencies (like network state), and how it fits into broader workflows (e.g., transaction preparation). This makes it harder for an agent to use correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters (blockTag and wallet). The description adds no parameter-specific information beyond what's in the schema, such as clarifying 'nonce' relates to the transaction count or explaining default behaviors. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get the number of transactions sent from this account (nonce)'. It specifies the verb ('Get'), resource ('number of transactions'), and scope ('from this account'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like wallet_get_balance or wallet_get_address, which also retrieve account-specific information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like wallet_get_balance (for balance queries) or provider_get_transaction (for transaction details), nor does it specify use cases like checking account activity or preparing new transactions. The agent must infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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