Skip to main content
Glama

Close empty token accounts (agent-owned app wallet)

close_empty_accounts
Idempotent

Close empty token accounts owned by an agent's app wallet and reclaim the rent, sending it to a sign-in wallet or back to the app wallet. Non-empty accounts are skipped; only rent is moved.

Instructions

Close every EMPTY token account of this agent's own app wallet (owner = the local P-256 key from create_app_wallet) and send the rent to the sign-in wallet (default) or back to the app wallet. A non-empty account is never included. The transaction is decoded and checked locally (only CloseAccount, authority = the app wallet, rent to the chosen destination) before the owner key signs. Moves only rent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationNowhere the rent goes; default app_wallet (then app_wallet_withdraw moves the SOL to your sign-in wallet)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1967

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the local decode/verification step (only CloseAccount, authority = the app wallet, rent to the chosen destination) performed before the owner key signs, and the blast radius ('Moves only rent'). This is exactly the kind of pre-signing safety context annotations cannot express.

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?

Three dense sentences, front-loaded with the scope and the non-empty exclusion before the mechanics. Slightly overloaded with parentheticals, but no sentence is wasted.

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?

With one optional param, annotations covering the safety profile, and no output schema, the description is nearly sufficient: it explains scope, exclusions, destination, and pre-sign verification. The only real gap is the destination-default conflict with the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so the parameter is already documented, but the description actively conflicts with it: it calls sign_in_wallet the default while the schema description says default app_wallet. That inconsistency can cause an agent to reason about the wrong default, which is worse than saying nothing.

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?

States a precise verb (close), resource (EMPTY token accounts), and scope (this agent's own app wallet, owner = local P-256 key), plus what happens to the recovered rent. It also implicitly separates itself from app_wallet_withdraw, which it names as the follow-on SOL-moving step.

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 condition for inclusion is explicit ('A non-empty account is never included'), and the default destination plus the alternative flow via app_wallet_withdraw are stated. It stops short of an explicit 'use this when you want to reclaim rent' framing, so it is clear context rather than full when/when-not guidance.

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