get_top_games
Retrieve a list of popular games from Twitch with customizable limits to discover trending content for streaming or viewing.
Instructions
人気のゲームのリストを取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 取得する最大ゲーム数(デフォルト: 20) |
Implementation Reference
- src/tools/handlers/game.ts:5-15 (handler)The handler function that fetches the top games using the Twitch API client and returns a formatted list of games with id, name, and boxArtUrl.export async function handleGetTopGames(apiClient: ApiClient, args: { limit?: number }) { const games = await apiClient.games.getTopGames({ limit: args.limit }); return formatResponse( games.data.map(game => ({ id: game.id, name: game.name, boxArtUrl: game.boxArtUrl, })) ); }
- src/tools/definitions.ts:32-46 (schema)Tool definition including name, description, and input schema for optional limit parameter.{ name: 'get_top_games', description: '人気のゲームのリストを取得します', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: '取得する最大ゲーム数(デフォルト: 20)', minimum: 1, maximum: 100, }, }, }, },
- src/index.ts:96-99 (registration)Dispatches the tool call to the handleGetTopGames function in the MCP server request handler.case 'get_top_games': return await handleGetTopGames(this.apiClient, { limit: args.limit as number | undefined });