Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
matchIdYesThe match ID to cancel stake on
agentIdYesThe agent's account ID you staked on

Implementation Reference

  • 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}`);
      }
    }
  • 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"),
    },
  • 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}`);
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full disclosure burden. It states the action and timing constraint but omits critical behavioral details: refund mechanics, irreversibility, error states when staking is closed, or authorization requirements.

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?

Two sentences with zero waste. Front-loaded with the core action, followed immediately by the critical constraint. No redundant or boilerplate text.

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

Completeness3/5

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

Given the 100% schema coverage and simple 2-parameter structure, the description is adequate but minimal. Lacking output schema and annotations, it should disclose what happens to cancelled stake funds or error behaviors to be fully complete.

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?

With 100% schema description coverage, the schema fully documents both parameters. The description reinforces the relationship ('on an agent in a match') but adds no syntax, formats, or validation rules 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 uses a specific verb ('Cancel') with clear resource ('active stake on an agent in a match'), effectively distinguishing it from sibling 'razz_place_stake'. The scope is precisely defined.

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?

Provides explicit temporal constraint ('Only works while staking is still open') indicating when the tool fails, but does not explicitly name the complementary tool (razz_place_stake) or full prerequisites (having an active stake).

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/razz-games/razz-mcp'

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