Skip to main content
Glama
lordbasilaiassistant-sudo

base-multi-wallet-mcp

get_gas_estimate

Estimate Base network gas costs for multi-wallet trading operations to calculate transaction fees before executing buys, sells, or transfers.

Instructions

Get current Base gas price and estimate cost for N wallet operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
num_walletsYesNumber of wallets involved
operation_typeYesType of operation to estimate

Implementation Reference

  • Handler function implementing gas estimation logic.
    async function handleGasEstimate(
      args: z.infer<typeof GasEstimateSchema>
    ): Promise<string> {
      const provider = getProvider();
      const feeData = await provider.getFeeData();
    
      const gasPrice = feeData.gasPrice ?? 0n;
      const maxFeePerGas = feeData.maxFeePerGas ?? gasPrice;
      const maxPriorityFee = feeData.maxPriorityFeePerGas ?? 0n;
    
      const gasLimit = GAS_LIMITS[args.operation_type] ?? 200_000n;
      const costPerTx = gasLimit * maxFeePerGas;
      const totalCost = costPerTx * BigInt(args.num_wallets);
    
      // Add 20% buffer
      const bufferedTotal = totalCost + totalCost / 5n;
    
      return JSON.stringify(
        {
          gas_price_gwei: ethers.formatUnits(gasPrice, "gwei"),
          max_fee_per_gas_gwei: ethers.formatUnits(maxFeePerGas, "gwei"),
          max_priority_fee_gwei: ethers.formatUnits(maxPriorityFee, "gwei"),
          operation: args.operation_type,
          gas_limit_per_tx: gasLimit.toString(),
          num_wallets: args.num_wallets,
          cost_per_tx_eth: formatEth(costPerTx),
          total_cost_eth: formatEth(totalCost),
          total_with_buffer_eth: formatEth(bufferedTotal),
          buffer: "20%",
        },
        null,
        2
  • Zod schema for input validation of get_gas_estimate.
    const GasEstimateSchema = z.object({
      num_wallets: z.number().describe("Number of wallets involved"),
      operation_type: z
        .enum(["buy", "sell", "transfer"])
        .describe("Type of operation to estimate"),
    });
  • src/index.ts:889-908 (registration)
    Tool registration in the MCP server definition.
    {
      name: "get_gas_estimate",
      description:
        "Get current Base gas price and estimate cost for N wallet operations.",
      inputSchema: {
        type: "object" as const,
        properties: {
          num_wallets: {
            type: "number",
            description: "Number of wallets involved",
          },
          operation_type: {
            type: "string",
            enum: ["buy", "sell", "transfer"],
            description: "Type of operation to estimate",
          },
        },
        required: ["num_wallets", "operation_type"],
      },
    },
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It explains that the tool performs estimation based on wallet count, but fails to disclose whether this is a read-only query, if it consumes API rate limits, or what currency/format the estimate returns.

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 single-sentence description is efficiently front-loaded with no wasted words. It packs the resource (Base gas), action (get/estimate), and parameter relationship (N operations) into 11 words.

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

Completeness3/5

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

For a two-parameter tool without output schema or annotations, the description adequately covers the core function. However, it misses the opportunity to clarify the return value structure (e.g., gas units vs. cost) or confirm read-only safety that annotations would typically provide.

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

Parameters4/5

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

With 100% schema coverage, the baseline is 3. The description adds valuable context by specifying 'Base' (likely the network) and linking the two parameters conceptually ('N wallet operations'), which helps the agent understand how num_wallets affects the estimate.

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 specifies the action ('Get', 'estimate') and scope (Base gas price, cost for N wallet operations). It distinguishes from execution-oriented siblings like coordinated_buy/sell by focusing on estimation. However, it doesn't explicitly clarify whether 'Base' refers to the Base L2 network or a base price, which could cause confusion.

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 lacks explicit guidance on when to use this tool versus its siblings (e.g., 'use this before coordinated_buy to estimate transaction costs'). Without such guidance, the agent must infer that estimation should precede execution.

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

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/lordbasilaiassistant-sudo/base-multi-wallet-mcp'

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