Skip to main content
Glama

prepare_native_stake_withdraw

DestructiveIdempotent

Build an unsigned transaction to withdraw SOL from an inactive stake account. Specify an amount or 'max' to fully close the account and reclaim rent.

Instructions

Build an unsigned native-stake withdraw tx. Pulls amountSol SOL (or 'max' for the full lamport balance) from an inactive stake account back into the wallet. 'max' closes the account and reclaims the rent-exempt seed; partial-withdraw leaves the account open. Stake MUST be inactive (one full epoch after deactivate) — on-chain reverts otherwise; the simulation gate catches it. DURABLE NONCE REQUIRED + same Ledger blind-sign treatment as prepare_native_stake_delegate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesSolana wallet — must be the stake account's withdrawer authority + receives the SOL. (For stakes created via prepare_native_stake_delegate, wallet === staker === withdrawer; no authority handoff is supported in this server.)
stakeAccountYesBase58 stake account address to withdraw from. Stake must be inactive (one full epoch after prepare_native_stake_deactivate). On-chain reverts if the stake is still cooling down — the simulation gate catches it.
amountSolYesHuman-readable SOL amount to withdraw (e.g. "1.5"), OR the literal string "max" to withdraw the full lamport balance (closes the stake account and reclaims the rent-exempt seed). Partial withdraws leave the account open with a smaller balance.
Behavior4/5

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

Beyond annotations (destructiveHint, readOnlyHint), the description adds key behaviors: 'max' closes the account and reclaims rent-exempt seed, partial withdrawals leave it open; the stake must be inactive; durable nonce required; same Ledger treatment as delegate. No contradiction with annotations.

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 extremely concise, using only four sentences to convey all key information without fluff. It front-loads the purpose and packs behavioral details, prerequisites, and parameter clarifications efficiently.

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

Completeness5/5

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

Given the three parameters, no output schema, and existing annotations, the description covers all necessary context: tool action, behavioral nuances, prerequisites (inactive stake, durable nonce), and parameter special values ('max'). It also mentions error handling (simulation gate). No gaps for an AI agent to use the tool correctly.

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?

The input schema already provides detailed descriptions for all three parameters (100% coverage). The description adds valuable context: clarifies that 'max' closes the account, explains the wallet must be the withdrawer authority, and reinforces the inactivity condition for stakeAccount. This enhances parameter meaning beyond the schema.

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 the tool builds an unsigned native-stake withdraw transaction, distinguishing between closing the account ('max') and partial withdrawal. It specifies the source (inactive stake account) and destination (wallet). This clearly differentiates it from siblings like prepare_native_stake_delegate or prepare_native_stake_deactivate.

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?

The description explicitly states that the stake must be inactive (one full epoch after deactivate) and mentions the simulation gate catches errors. It also notes that a durable nonce is required and the Ledger blind-sign treatment is the same as prepare_native_stake_delegate. While it doesn't list all alternatives, it gives clear prerequisites and readiness conditions.

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/recon-crypto-mcp'

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