Skip to main content
Glama

get_trending_rooms

Retrieve trending WebSim rooms to discover popular community projects and content. Use limit and offset parameters to control results.

Instructions

Get trending WebSim rooms

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of rooms to return (default: 20)
offsetNoNumber of rooms to skip (default: 0)

Input Schema (JSON Schema)

{ "properties": { "limit": { "default": 20, "description": "Number of rooms to return (default: 20)", "type": "number" }, "offset": { "default": 0, "description": "Number of rooms to skip (default: 0)", "type": "number" } }, "type": "object" }

Implementation Reference

  • The handler function for the 'get_trending_rooms' MCP tool. It extracts optional limit and offset parameters from args, calls the apiClient.getTrendingRooms helper, formats the JSON response with success status and data, and returns it as MCP content.
    handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.getTrendingRooms(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} trending rooms` }, null, 2) }] }; }
  • The input schema for the get_trending_rooms tool, defining an object with optional 'limit' and 'offset' number parameters, both with defaults.
    inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of rooms to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of rooms to skip (default: 0)", default: 0 } } },
  • server.js:753-785 (registration)
    The full tool registration object added to the 'tools' array. This defines the name, description, inputSchema, and handler for 'get_trending_rooms', which is used by the MCP server's ListTools and CallTool handlers.
    { name: "get_trending_rooms", description: "Get trending WebSim rooms", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of rooms to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of rooms to skip (default: 0)", default: 0 } } }, handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.getTrendingRooms(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} trending rooms` }, null, 2) }] }; } },
  • The helper method in WebSimAPIClient class that constructs the API request to fetch trending rooms from '/api/v1/feed/rooms' endpoint with pagination parameters, used by the tool handler.
    async getTrendingRooms(limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/feed/rooms?${params}`); }

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/gigachadtrey/websimm'

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