Skip to main content
Glama

prepare_weth_unwrap

DestructiveIdempotent

Build an unsigned transaction to unwrap WETH to native ETH on supported chains via a direct WETH.withdraw() call. Accepts a decimal amount or 'max' to withdraw the full balance, with a balance pre-check.

Instructions

Build an unsigned WETH → native ETH unwrap transaction via a direct WETH.withdraw(uint256) call on the canonical WETH9 contract for the target chain. Supported chains: ethereum, arbitrum, polygon, base, optimism. Pass an explicit decimal amount (e.g. "0.5") or the literal "max" to unwrap the full WETH balance. WETH is always 18 decimals. No approval is required — the wallet burns its own balance and receives native ETH back in the same call; the call is cheaper than routing through a DEX/aggregator. Balance is checked pre-build and the call refuses with a clear message if the wallet is short, rather than letting the tx revert on-chain. For the symmetric wrap direction (native ETH → WETH), use prepare_native_send with the WETH contract as to — sending ETH to the WETH9 fallback triggers deposit() automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYes
chainNoethereum
amountYesHuman-readable WETH amount, NOT raw wei. Example: "0.5" for 0.5 WETH. Pass "max" to unwrap the full WETH balance. WETH is always 18 decimals on every supported chain.
Behavior4/5

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

Adds value beyond annotations by disclosing that no approval is required, a pre-build balance check exists to prevent on-chain reverts, and the call is cheaper than DEX/aggregator. Annotations already indicate destructive and idempotent nature, but the description enriches this with specific behavioral details.

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 concise yet covers all essential aspects: action, mechanism, chain support, amount format, balance check, no approval, and symmetric alternative. Each sentence serves a purpose without redundancy.

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?

Covers usage, safety, and alternatives well. However, there is no output schema and the description does not specify the return format or structure of the built transaction. Given tool complexity and available annotations, it is nearly complete but lacks output details.

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 coverage is 33% (only amount has description). The tool description reiterates the chains list and amount format (decimal or 'max'), but the amount parameter is already fully described in the schema. For wallet and chain, it adds minimal new insight beyond what the schema provides (pattern, enum).

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

Purpose5/5

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

The description clearly states it builds an unsigned WETH unwrap transaction via WETH.withdraw() on canonical contracts. It distinguishes from the wrap direction by naming prepare_native_send as the symmetric tool, and lists supported chains.

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?

Provides explicit when-to-use context (unwrap WETH to native ETH), mentions balance check pre-build, no approval needed, and points to the wrapping sibling tool. However, it does not explicitly state when not to use or alternative unwrap methods beyond the sibling.

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/szhygulin/vaultpilot-mcp'

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