Skip to main content
Glama

wallet_populate_transaction

Complete Ethereum and EVM-compatible transactions by auto-filling missing fields such as gas, nonce, or fees using wallet details and transaction data.

Instructions

Populate a transaction with missing fields

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionYesThe transaction to populate
walletNoThe wallet (private key, mnemonic, or JSON). If not provided, uses PRIVATE_KEY environment variable if set.

Implementation Reference

  • The core handler function that populates the transaction object using the ethers Wallet's populateTransaction method, filling in missing fields like nonce, gas, etc., based on the provider.
    export const populateTransactionHandler = async (input: any): Promise<ToolResultSchema> => {
      try {
        if (!input.transaction) {
          return createErrorResponse("Transaction is required");
        }
    
        const wallet = await getWallet(input.wallet, input.password);
    
        if (!wallet.provider) {
          return createErrorResponse("Provider is required to populate a transaction, please set the provider URL");
        }
    
        const populatedTx = await wallet.populateTransaction(input.transaction);
    
        return createSuccessResponse(
        `Transaction populated successfully
          To: ${populatedTx.to}
          From: ${populatedTx.from}
          Nonce: ${populatedTx.nonce?.toString() ?? "Not specified"}
          Gas limit: ${populatedTx.gasLimit?.toString() ?? "Not specified"}
          Gas price: ${populatedTx.gasPrice?.toString() ?? "Not specified"}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to populate transaction: ${(error as Error).message}`);
      }
    };
  • The input schema definition for the wallet_populate_transaction tool, specifying parameters like wallet and transaction object.
    {
      name: "wallet_populate_transaction",
      description: "Populate a transaction with missing fields",
      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." },
          transaction: { 
            type: "object", 
            description: "The transaction to populate",
            properties: {
              to: { type: "string" },
              from: { type: "string" },
              data: { type: "string" },
              value: { type: "string" },
              gasLimit: { type: "string" },
              gasPrice: { type: "string" },
              nonce: { type: "number" },
              type: { type: "number" },
              maxFeePerGas: { type: "string" },
              maxPriorityFeePerGas: { type: "string" }
            },
            required: ["to"]
          }
        },
        required: ["transaction"]
      }
    },
  • src/tools.ts:581-581 (registration)
    The registration of the populateTransactionHandler to the 'wallet_populate_transaction' tool name in the handlers dictionary.
    "wallet_populate_transaction": populateTransactionHandler,
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does at a high level. It doesn't disclose whether this is a read-only operation, whether it modifies state, what authentication is needed, rate limits, or what happens when fields are populated. 'Populate' implies mutation but lacks behavioral details needed for safe invocation.

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

Conciseness4/5

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

The description is a single clear sentence with zero waste - it's appropriately sized for a simple tool. However, it's not front-loaded with critical context about when to use it, and could benefit from more structure to guide the agent.

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?

For a transaction manipulation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what gets returned, what 'populate' actually means operationally, or how this differs from similar wallet tools. The agent lacks sufficient context to use this tool effectively without trial and error.

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 already documents both parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema - it doesn't explain what 'missing fields' refers to in the transaction object or how the wallet parameter interacts with the environment variable fallback. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description 'Populate a transaction with missing fields' clearly states the verb ('populate') and resource ('transaction'), but it's vague about what 'missing fields' means and doesn't distinguish this tool from sibling wallet tools like wallet_send_transaction or wallet_sign_transaction. It provides basic purpose but lacks specificity about what kind of population occurs.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, when this tool is appropriate versus wallet_send_transaction, or what scenarios require transaction population. Without any usage context, agents must infer from the name 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