Skip to main content
Glama

wallet_send_transaction

Send Ethereum or EVM-compatible blockchain transactions using wallet credentials, specifying recipient, value, gas, and other parameters to execute transfers or contract interactions.

Instructions

Send a transaction

Input Schema

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

Implementation Reference

  • The sendTransactionHandler function implements the core logic for the wallet_send_transaction tool. It validates input, retrieves the wallet, ensures a provider is set, sends the transaction via wallet.sendTransaction(input.transaction), and returns transaction details or an error.
    export const sendTransactionHandler = 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 send a transaction, please set the provider URL");
        }
    
        const tx = await wallet.sendTransaction(input.transaction);
    
        return createSuccessResponse(
        `Transaction sent successfully
          Hash: ${tx.hash}
          Nonce: ${tx.nonce.toString()}
          Gas limit: ${tx.gasLimit.toString()}
          Gas price: ${tx.gasPrice?.toString()}
          Data: ${tx.data}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to send transaction: ${(error as Error).message}`);
      }
    };
  • Defines the input schema and description for the wallet_send_transaction tool, specifying the required transaction object with fields like to, data, value, etc.
    {
      name: "wallet_send_transaction",
      description: "Send a transaction",
      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 send",
            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:579-579 (registration)
    Maps the tool name 'wallet_send_transaction' to its handler function sendTransactionHandler in the handlers dictionary.
    "wallet_send_transaction": sendTransactionHandler,
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavioral traits. 'Send a transaction' implies a write operation that likely modifies blockchain state, but it fails to describe critical behaviors: whether it requires authentication, has rate limits, returns a transaction hash or receipt, is irreversible, or involves gas costs. The description adds no value beyond the basic implication of sending.

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 extremely concise with just two words, 'Send a transaction', which is front-loaded and wastes no space. While this conciseness contributes to under-specification in other dimensions, it earns full marks for brevity and lack of redundancy.

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

Completeness1/5

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

Given the complexity of sending a blockchain transaction (a write operation with financial implications), no annotations, no output schema, and rich sibling tools, the description is severely incomplete. It does not cover behavioral aspects, usage context, or output expectations, leaving critical gaps for safe and effective tool invocation by an AI agent.

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%, with clear descriptions for both parameters ('transaction' and 'wallet'). The description adds no semantic information beyond what the schema provides (e.g., it doesn't explain transaction structure or wallet formats). However, with high schema coverage, the baseline score is 3, as the schema adequately documents parameters without needing description supplementation.

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

Purpose2/5

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

The description 'Send a transaction' is a tautology that merely restates the tool name 'wallet_send_transaction'. It does not specify what type of transaction (e.g., cryptocurrency, blockchain), what resource it acts upon, or distinguish it from siblings like 'wallet_sign_transaction' or 'wallet_call'. This provides minimal actionable information beyond the name.

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

Usage Guidelines1/5

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

The description offers no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing a wallet or transaction data), exclusions, or comparisons to sibling tools like 'wallet_call' (for read-only calls) or 'wallet_sign_transaction' (for signing without sending). This leaves the agent with no context for appropriate tool selection.

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