Skip to main content
Glama

Ensure gas

agentgas_ensure_gas
Read-only

Free. Checks a wallet's native gas balance on base/arbitrum/optimism/polygon. If it is at least min, returns needed:false (nothing to pay). Otherwise returns the exact top-up to reach target (default 2 x min), the price with your loyalty fee, an x402 URL to pay (pay_with_x402.url) and, if you hold AgentGas credit, a ready-to-sign credit message (pay_with_credit). Call before each on-chain action.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "to": "<to>",
      "min": "<min>"
    },
    "name": "agentgas_ensure_gas"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesWallet to check / top up
minYesMinimum native balance needed, e.g. 0.00002
chainNoDestination chain for the native gas
payerNoPaying wallet (loyalty fee, credit). Defaults to to.
targetNoBalance to top up to (default 2 x min)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.6/5.0
Behavior3/5

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

With readOnlyHint=true and openWorldHint=true already supplied, the description correctly stays consistent by describing a check that returns payment instructions rather than performing the top-up, and it discloses the two outcome branches (needed:false vs. a top-up with x402 URL and credit message). That is meaningful added context, but it omits operational details such as whether the check hits chain state in real time or the freshness/expiry of the returned x402 URL.

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?

Leads with the highest-value fact ('Free.') and the core action before the return detail, with no filler. The second sentence is a long packed clause covering branches, fee, and two payment paths, which is dense but every element is load-bearing.

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

Completeness4/5

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

For a 5-parameter tool with no output schema, the description does solid work explaining the conditional return values and the 'Call before each on-chain action' workflow. The gaps are the unspecified default for the optional chain parameter and any note on x402 URL lifetime or failure modes.

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 every one of the five parameters is already documented, including the 'default 2 x min' target and the payer loyalty-fee behavior; the description largely restates these. It adds no format or edge-case guidance (for example, what chain is assumed when the optional chain is omitted), so the baseline of 3 holds.

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?

Names a specific verb and resource ('Checks a wallet's native gas balance') plus the supported chains, so it is clearly distinct from agentgas_order or agentgas_credit_message. It does not differentiate itself from the closest sibling, agentgas_quote, even though it also returns 'the price with your loyalty fee', leaving mild ambiguity about which to call for pricing alone.

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

Usage Guidelines4/5

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

Gives an explicit trigger ('Call before each on-chain action'), which tells the agent exactly when to reach for it. It does not name alternatives or state when not to use it, so an agent cannot resolve the quote overlap from this description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources