Skip to main content
Glama
lordbasilaiassistant-sudo

base-gasless-deploy-mcp

estimate_gas_savings

Calculate gas savings for token deployments using a paymaster to reduce transaction costs on Base network.

Instructions

Show how much gas was saved (or would be saved) by using the paymaster for a token deployment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_addressYesToken contract address to check gas savings for

Implementation Reference

  • The implementation handler for the estimate_gas_savings tool.
    async ({ token_address }) => {
      try {
        const provider = getProvider();
    
        // Check if we have a deploy record
        const record = deployments.find(
          (d) => d.tokenAddress.toLowerCase() === token_address.toLowerCase()
        );
    
        // Get current gas prices for estimation
        const feeData = await provider.getFeeData();
        const gasPrice = feeData.gasPrice || 0n;
    
        // Typical ERC-20 deploy gas: ~700k-1M gas units
        // Use actual if we have it, otherwise estimate
        const gasUsed = record ? BigInt(record.gasUsed) : 850000n;
        const estimatedCostWei = gasUsed * gasPrice;
        const estimatedCostEth = ethers.formatEther(estimatedCostWei);
    
        // Get ETH price estimate (rough)
        const ethPriceUsd = 2500; // Approximate
    
        const result: Record<string, unknown> = {
          token_address,
          gas_units_used: gasUsed.toString(),
          current_gas_price_gwei: ethers.formatUnits(gasPrice, "gwei"),
          estimated_cost_eth: estimatedCostEth,
          estimated_cost_usd: `$${(parseFloat(estimatedCostEth) * ethPriceUsd).toFixed(4)}`,
          eth_price_estimate_usd: ethPriceUsd,
          paymaster_configured: isPaymasterEnabled(),
        };
    
        if (record) {
          result.actual_gas_used = record.gasUsed;
          result.actual_gas_cost_wei = record.gasCostWei;
          result.actual_gas_cost_eth = ethers.formatEther(BigInt(record.gasCostWei));
          result.used_paymaster = record.usedPaymaster;
          result.gas_saved_eth = record.usedPaymaster
            ? ethers.formatEther(BigInt(record.gasCostWei))
            : "0";
          result.gas_saved_usd = record.usedPaymaster
            ? `$${(parseFloat(ethers.formatEther(BigInt(record.gasCostWei))) * ethPriceUsd).toFixed(4)}`
            : "$0";
          result.status = record.usedPaymaster
            ? "Gas was fully sponsored by paymaster"
            : "Gas was paid by deployer (paymaster not used)";
        } else {
  • src/index.ts:268-273 (registration)
    The registration of the estimate_gas_savings tool.
    server.tool(
      "estimate_gas_savings",
      "Show how much gas was saved (or would be saved) by using the paymaster for a token deployment.",
      {
        token_address: z.string().describe("Token contract address to check gas savings for"),
      },
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 mentions the tool shows gas savings 'saved (or would be saved)', hinting at both retrospective and predictive analysis, but lacks details on permissions, rate limits, response format, or error handling. For a tool with zero annotation coverage, this is insufficient.

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, efficient sentence that clearly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, though it could be slightly more structured by separating usage context from core functionality.

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 (involving gas savings analysis), no annotations, and no output schema, the description is minimally adequate. It covers the core purpose but lacks details on behavioral traits, output format, and integration with sibling tools, leaving gaps for an AI agent to fully understand usage.

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 schema description coverage is 100%, with the single parameter 'token_address' fully documented in the schema as 'Token contract address to check gas savings for'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3.

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: 'Show how much gas was saved (or would be saved) by using the paymaster for a token deployment.' It specifies the action (show gas savings), resource (token deployment), and mechanism (using paymaster). However, it doesn't explicitly differentiate from sibling tools like 'deploy_gasless_token' or 'get_token_info', which prevents a score of 5.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'token deployment' and 'paymaster', suggesting this tool is for analyzing gas savings related to deployments. However, it provides no explicit guidance on when to use this versus alternatives like 'deploy_gasless_token' (for actual deployment) or 'get_token_info' (for general token data), nor does it specify prerequisites or exclusions.

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-gasless-deploy-mcp'

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