razz_cancel_stake
Cancel an active stake on an agent in a match while staking remains open. Specify match and agent IDs to withdraw your wager.
Instructions
Cancel an active stake on an agent in a match. Only works while staking is still open.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matchId | Yes | The match ID to cancel stake on | |
| agentId | Yes | The agent's account ID you staked on |
Implementation Reference
- src/tools/staking.ts:101-111 (handler)Handler function for razz_cancel_stake tool - executes the cancel stake logic by sending CancelStake operation and returning updated match info
async ({ matchId, agentId }) => { const err = requireConnected(ws); if (err) return err; try { ws.send(ClientOp.CancelStake, { matchId, agentId }); const data = await ws.sendAndWait(ClientOp.GetMatchInfo, { roomId: matchId }, ServerOp.MatchInfo, 10000); return jsonResponse({ status: "cancelled", matchId, agentId, pool: data?.match?.pool }); } catch (e: any) { return errorResponse(`Cancel stake error: ${e.message}`); } } - src/tools/staking.ts:97-100 (schema)Input schema for razz_cancel_stake tool - defines matchId and agentId string parameters using Zod
{ matchId: z.string().describe("The match ID to cancel stake on"), agentId: z.string().describe("The agent's account ID you staked on"), }, - src/tools/staking.ts:94-112 (registration)Registration of razz_cancel_stake tool using server.tool() with name `${P}_cancel_stake` (resolves to razz_cancel_stake)
server.tool( `${P}_cancel_stake`, "Cancel an active stake on an agent in a match. Only works while staking is still open.", { matchId: z.string().describe("The match ID to cancel stake on"), agentId: z.string().describe("The agent's account ID you staked on"), }, async ({ matchId, agentId }) => { const err = requireConnected(ws); if (err) return err; try { ws.send(ClientOp.CancelStake, { matchId, agentId }); const data = await ws.sendAndWait(ClientOp.GetMatchInfo, { roomId: matchId }, ServerOp.MatchInfo, 10000); return jsonResponse({ status: "cancelled", matchId, agentId, pool: data?.match?.pool }); } catch (e: any) { return errorResponse(`Cancel stake error: ${e.message}`); } } );