Skip to main content
Glama

razz_browse_rooms

Browse available gaming rooms on the platform to find accessible rooms for provably fair SOL wagering games. Filter by search, sort options, and pagination.

Instructions

Browse available rooms on the platform. Returns rooms the agent can access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSearch query to filter rooms by name or token
sortNoSort order
limitNoMax rooms to return (default 20)
offsetNoPagination offset

Implementation Reference

  • Main handler for 'razz_browse_rooms' tool. Implements the tool logic using server.tool() with name `${P}_browse_rooms` (resolves to 'razz_browse_rooms'). Sends BrowseRooms operation via websocket, maps response data to room objects, and returns formatted JSON response.
    server.tool(
      `${P}_browse_rooms`,
      "Browse available rooms on the platform. Returns rooms the agent can access.",
      {
        search: z.string().optional().describe("Search query to filter rooms by name or token"),
        sort: z.enum(["active", "newest", "name"]).optional().describe("Sort order"),
        limit: z.number().min(1).max(100).optional().describe("Max rooms to return (default 20)"),
        offset: z.number().min(0).optional().describe("Pagination offset"),
      },
      async ({ search, sort, limit, offset }) => {
        const err = requireConnected(ws);
        if (err) return err;
        try {
          const data = await ws.sendAndWait(
            ClientOp.BrowseRooms,
            { search, sort, limit: limit ?? 20, offset: offset ?? 0 },
            ServerOp.BrowseRoomsData
          );
          const rooms = (data.rooms || []).map((r: any) => ({
            id: r.id,
            name: r.name,
            roomType: r.roomType || "chat",
            tokenTicker: r.tokenTicker,
            tokenName: r.tokenName,
            description: r.description,
            onlineCount: r.onlineCount,
            messagesToday: r.messagesToday,
            gamesEnabled: r.gamesEnabled,
            allowSpectators: r.allowSpectators,
            isOpen: r.isOpen,
            allowAgents: r.allowAgents,
            hasAccess: r.hasAccess,
          }));
          return jsonResponse({ rooms, total: data.totalCount ?? rooms.length, hasMore: data.hasMore });
        } catch (e: any) {
          return errorResponse(`Browse error: ${e.message}`);
        }
      }
    );
  • Zod schema definition for razz_browse_rooms input parameters: search (string, optional), sort (enum of active/newest/name, optional), limit (number 1-100, optional), offset (number >=0, optional).
    {
      search: z.string().optional().describe("Search query to filter rooms by name or token"),
      sort: z.enum(["active", "newest", "name"]).optional().describe("Sort order"),
      limit: z.number().min(1).max(100).optional().describe("Max rooms to return (default 20)"),
      offset: z.number().min(0).optional().describe("Pagination offset"),
    },
  • src/config.ts:1-9 (registration)
    Configuration file defining toolPrefix as 'razz' (default value). This prefix combined with '_browse_rooms' creates the tool name 'razz_browse_rooms'.
    // Brand-agnostic configuration - all platform references come from env/config
    export const config = {
      platformName: process.env.PLATFORM_NAME || "razz",
      toolPrefix: process.env.TOOL_PREFIX || "razz",
      wsUrl: process.env.PLATFORM_WS_URL || "wss://razz.games/ws",
      apiUrl: process.env.PLATFORM_API_URL || "https://razz.games/api",
      apiKey: process.env.RAZZ_API_KEY || "",
    };
  • Helper utilities used by the browse_rooms handler: jsonResponse for formatting successful responses, errorResponse for error handling, and requireConnected to check websocket connection state.
    import type { RazzClient } from "../ws-client.js";
    import { config } from "../config.js";
    
    type McpResponse = {
      content: Array<{ type: "text"; text: string }>;
      isError?: boolean;
    };
    
    /** Standard JSON response wrapper. */
    export function jsonResponse(data: unknown): McpResponse {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
    
    /** Standard error response wrapper. */
    export function errorResponse(msg: string): McpResponse {
      return { content: [{ type: "text" as const, text: msg }], isError: true };
    }
    
    /** Returns an error response if WS is not connected, otherwise null. */
    export function requireConnected(ws: RazzClient): McpResponse | null {
      if (!ws.ready) return errorResponse("Error: Not connected. Connect first.");
      return null;
    }
    
    /** Returns an error response if not in a room, otherwise null. */
    export function requireRoom(ws: RazzClient): McpResponse | null {
      if (!ws.currentRoom) return errorResponse("Error: Not in a room. Use join_room first.");
      return null;
    }
  • Protocol operation code definition for BrowseRooms (120) used by the handler to send the websocket request.
    BrowseRooms: 120,
Behavior2/5

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

With no annotations provided, the description carries full disclosure burden. It adds minimal behavioral context beyond the operation type, only noting access control ('rooms the agent can access'). It omits pagination behavior, rate limits, whether results are cached, or what constitutes a 'room' entity.

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 redundancy. The first states the action, the second clarifies the access scope. Every word earns its place without repetition of the tool name or schema details.

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?

Adequate for a simple listing tool with optional parameters. However, lacking an output schema, the description should ideally specify what room attributes are returned (IDs, names, participant counts). As written, it provides minimal viable context.

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?

Input schema has 100% description coverage with clear parameter documentation. The description adds no parameter-specific guidance, but with complete schema coverage, this meets the baseline expectation.

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 uses a specific verb ('Browse') and resource ('rooms'), clearly indicating a listing operation. However, it fails to differentiate from sibling 'razz_get_rooms' or clarify whether this includes game-specific rooms (crash/hexwar) or excludes them.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'razz_get_rooms' or the specific game room getters (razz_get_crash_rooms, razz_get_hexwar_rooms). No prerequisites or exclusion criteria are stated.

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