Skip to main content
Glama
staccDOTsol

fomox402 — Last-Bidder-Wins on Solana

claim_winnings

Settle an expired last-bidder-wins round by invoking the claim instruction, distributing the pot to the winner, creator, referrer, and dev. Permissionless—anyone can pay the tx fee to trigger payouts.

Instructions

Settle a finished round and pay out the winner.

WHAT IT DOES: invokes the Anchor program's claim instruction, which atomically distributes the pot per the round's split bps: winnerBps → last bidder (the winner) creatorBps → round creator refsBps → winner's referrer (if set) devBps → staccpad.fun dev wallet Marks the round gameOver=true so list_games filters it out.

WHEN TO USE: after a round's deadline has passed (deadline ≤ now) and the round is not yet gameOver. The broker also runs an autoclaim worker that calls this on your behalf within ~30s of expiry, so manual claims are an optimization, not a requirement.

PERMISSIONLESS: anyone can call claim_winnings on any expired round — the on-chain program routes the funds correctly regardless of who pays the tx fee. So if you're the winner and the auto-claim worker is slow, just call this yourself.

RETURNS: { tx (Solana sig), gameId, payouts: { winner: { address, amountRaw }, creator: {...}, ref?: {...}, dev: {...} } }.

FAILURE MODES: claim_failed (not_expired) — deadline hasn't passed yet claim_failed (already_claimed) — round was already settled (gameOver) claim_failed (rpc) — Solana RPC issue, retry in a few seconds

RELATED: claim_dividend (the per-key share — separate from this winner payout), get_game (verify deadline), play (auto-handles winner check).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gameIdYesRound to settle. Must be expired (deadline ≤ now) and not yet gameOver.
api_keyNoBearer api_key (or env). Pays the Solana network fee but does NOT need to be the winner — anyone can settle on the winner's behalf.
Behavior5/5

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

Despite no annotations, the description fully discloses behavioral traits: atomic distribution, marks gameOver=true, permissionless calling, and lists precise failure modes. No contradictions.

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?

Well-structured with clear sections (WHAT IT DOES, WHEN TO USE, etc.), front-loaded summary, and every sentence adds value despite length.

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?

Fully covers the tool's behavior, return fields (despite no output schema), failure modes, and relations to siblings, making it complete for a complex on-chain tool.

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

Parameters5/5

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

Input schema has 100% coverage with detailed descriptions; description adds meaningful context like expiry requirements and fee payer flexibility, going beyond schema basics.

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 'Settle a finished round and pay out the winner.' and elaborates on the on-chain instruction and fund distribution, distinguishing it from siblings like claim_dividend and get_game.

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

Usage Guidelines5/5

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

Explicitly provides WHEN TO USE section specifying conditions (deadline passed, not gameOver), mentions autoclaim worker as alternative, and outlines failure modes for common errors.

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/staccDOTsol/staccbot-tg'

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