Skip to main content
Glama

get_stream_info

Retrieve live stream details from Twitch, including viewer count, game, and status, by providing a channel name.

Instructions

配信情報を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelNameYesTwitchチャンネル名

Implementation Reference

  • The handler function that implements the get_stream_info tool logic, fetching the stream status and details for a given Twitch channel using the Twitch API.
    export async function handleGetStreamInfo(apiClient: ApiClient, args: { channelName: string }) {
      const user = await getUserByName(apiClient, args.channelName);
      const stream = await apiClient.streams.getStreamByUserId(user.id);
    
      if (!stream) {
        return formatResponse({
          status: 'offline',
          message: `${user.displayName} is currently offline`,
          lastOnline: null
        });
      }
    
      return formatResponse({
        status: 'online',
        title: stream.title,
        game: stream.gameName,
        viewers: stream.viewers,
        startedAt: stream.startDate,
        language: stream.language,
        thumbnailUrl: stream.thumbnailUrl,
        tags: stream.tags,
      });
    }
  • The tool schema definition for get_stream_info, specifying the input schema with channelName parameter.
      name: 'get_stream_info',
      description: '配信情報を取得します',
      inputSchema: {
        type: 'object',
        properties: {
          channelName: {
            type: 'string',
            description: 'Twitchチャンネル名',
          },
        },
        required: ['channelName'],
      },
    },
  • src/index.ts:91-94 (registration)
    The registration in the tool dispatch switch statement, mapping the tool name to its handler function.
    case 'get_stream_info':
      return await handleGetStreamInfo(this.apiClient, {
        channelName: args.channelName as string
      });

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