Skip to main content
Glama

Close Token Accounts

build-close-token-accounts
Destructive

Close Token Accounts. Calls only POST /v4/wallets/util/close-token-accounts and returns an unsigned transaction for the user to sign. This tool does not sign, submit, or broadcast, and it does not accept a private key. Solana API endpoint for closing empty Solana token accounts. Build a transaction to close Token-2022 and SPL token accounts to recover locked SOL.

Input Schema

NameRequiredDescriptionDefault
bodyYesRequest payload model for close token accounts param parameters used by this API endpoint.

Output Schema

NameRequiredDescriptionDefault
bodyNo
statusNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the risk profile is structured. The description adds genuinely new behavioral detail: it clarifies the tool only builds an unsigned transaction and never signs or broadcasts, and that it declines private keys — important for an agent reasoning about the security boundary. Return-format coverage is handled by the output schema.

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?

Front-loaded with the endpoint and the unsigned-transaction contract, and the sentences are mostly information-bearing. The second sentence about the Solana API endpoint for closing empty token accounts overlaps somewhat with the first, but nothing is seriously wasteful.

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?

For a destructive build-transaction tool with rich annotations and an output schema, the description covers the crucial gaps: it states what is mutated (token accounts), what is returned (unsigned transaction), and what the tool refuses to do (sign/submit, accept keys). An agent has enough to invoke it safely.

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%, with gasless, partner, rentFee, ownerAddress, and accountAddresses all documented in-schema. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies — the schema, not the prose, carries parameter semantics.

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 names the specific endpoint (POST /v4/wallets/util/close-token-accounts) and states the concrete outcome: an unsigned transaction to close Token-2022 and SPL token accounts and recover locked SOL. The action is unambiguous, though the opening 'Close Token Accounts' merely restates the title, and it doesn't explicitly contrast with build-swap, the closest sibling.

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?

It gives context (closing empty token accounts to recover locked SOL) and a hard constraint (does not sign, submit, broadcast, or accept a private key), which implies a build-then-sign-user-side workflow. But it never tells the agent when to prefer this over siblings like get-wallet-empty-accounts (which surfaces accounts to close) or build-swap, leaving the selection implicit.

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.