Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

estimate_gas

Calculate transaction gas costs on multiple blockchains to optimize network fees before execution.

Instructions

Estimate gas required for a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
transactionYesTransaction object with from, to, data, value, etc.
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • The handler logic for the 'estimate_gas' tool. Extracts parameters from args and delegates to AdvancedBlockchainService.estimateGas, then formats the response as MCP content.
    case 'estimate_gas': {
      const blockchain = args?.blockchain as string;
      const transaction = args?.transaction as any;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await advancedBlockchain.estimateGas(blockchain, transaction, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Input schema definition for the 'estimate_gas' tool, specifying required blockchain, transaction object, and optional network.
    inputSchema: {
      type: 'object',
      properties: {
        blockchain: {
          type: 'string',
          description: 'Blockchain name',
        },
        transaction: {
          type: 'object',
          description: 'Transaction object with from, to, data, value, etc.',
        },
        network: {
          type: 'string',
          enum: ['mainnet', 'testnet'],
          description: 'Network type (defaults to mainnet)',
        },
      },
      required: ['blockchain', 'transaction'],
    },
  • Tool object registration for 'estimate_gas' returned by registerTransactionHandlers, including name, description, and schema. Added to global tools list in src/index.ts.
    {
      name: 'estimate_gas',
      description: 'Estimate gas required for a transaction',
      inputSchema: {
        type: 'object',
        properties: {
          blockchain: {
            type: 'string',
            description: 'Blockchain name',
          },
          transaction: {
            type: 'object',
            description: 'Transaction object with from, to, data, value, etc.',
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['blockchain', 'transaction'],
      },
    },
  • Supporting method in AdvancedBlockchainService that performs the actual RPC call to 'eth_estimateGas' via the blockchain service.
    async estimateGas(
      blockchain: string,
      transaction: any,
      network: 'mainnet' | 'testnet' = 'mainnet'
    ): Promise<EndpointResponse> {
      const service = this.blockchainService.getServiceByBlockchain(blockchain, network);
    
      if (!service) {
        return {
          success: false,
          error: `Blockchain service not found: ${blockchain} (${network})`,
        };
      }
    
      return this.blockchainService.callRPCMethod(
        service.id,
        'eth_estimateGas',
        [transaction]
      );
    }
Behavior2/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 of behavioral disclosure. It states the tool estimates gas but doesn't explain how (e.g., simulation-based, heuristic), whether it's read-only or has side effects, error handling, or performance characteristics. For a tool with no annotation coverage, this is a significant gap in transparency.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for a straightforward tool, earning full marks for conciseness.

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?

Given the tool's moderate complexity (3 parameters including a nested object) and no annotations or output schema, the description is minimally adequate. It states the purpose but lacks behavioral details, usage context, and output expectations. With 100% schema coverage, it meets a basic threshold but doesn't fully compensate for missing structured data.

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?

The input schema has 100% description coverage, so the schema already documents all parameters ('blockchain', 'transaction', 'network') thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't clarify transaction structure or gas estimation nuances). 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 with a specific verb ('estimate') and resource ('gas required for a transaction'), making it immediately understandable. However, it doesn't distinguish this tool from potential sibling tools like 'get_gas_price' or 'get_solana_fee_for_message', which might have overlapping gas-related functionality, so it doesn't reach the highest score.

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. With many sibling tools available (e.g., 'get_gas_price', 'get_solana_fee_for_message'), there's no indication of context, prerequisites, or exclusions. This leaves the agent guessing about appropriate usage scenarios.

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/buildwithgrove/mcp-pocket'

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