Skip to main content
Glama

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
NameRequiredDescriptionDefault
limitNo取得する最大ゲーム数(デフォルト: 20)

Implementation Reference

  • 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,
        }))
      );
    }
  • 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
      });

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/mtane0412/twitch-mcp-server'

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