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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of rooms to return (default: 20) | |
| offset | No | Number 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
- server.js:771-784 (handler)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) }] }; }
- server.js:756-770 (schema)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) }] }; } },
- server.js:180-183 (helper)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}`); }