get_streams
Retrieve live Twitch streams with filters for game, language, and result count to monitor current broadcasts.
Instructions
現在ライブ配信中のストリームを取得します
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_streams"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game | No | ゲーム名でフィルター | |
| language | No | 言語でフィルター (例: ja, en) | |
| limit | No | 取得する最大ストリーム数(デフォルト: 20) |
Implementation Reference
- src/tools/handlers/stream.ts:28-51 (handler)The handler function that executes the tool logic: fetches live streams filtered by game, language, or limit using Twitch API and maps the response.
export async function handleGetStreams( apiClient: ApiClient, args: { game?: string; language?: string; limit?: number } ) { const streams = await apiClient.streams.getStreams({ game: args.game, language: args.language, limit: args.limit, }); return formatResponse( streams.data.map(stream => ({ userId: stream.userId, userName: stream.userName, title: stream.title, game: stream.gameName, viewers: stream.viewers, startedAt: stream.startDate, language: stream.language, thumbnailUrl: stream.thumbnailUrl, tags: stream.tags, })) ); } - src/tools/definitions.ts:102-123 (schema)Tool schema definition specifying the name, description, and input schema for get_streams.
name: 'get_streams', description: '現在ライブ配信中のストリームを取得します', inputSchema: { type: 'object', properties: { game: { type: 'string', description: 'ゲーム名でフィルター', }, language: { type: 'string', description: '言語でフィルター (例: ja, en)', }, limit: { type: 'number', description: '取得する最大ストリーム数(デフォルト: 20)', minimum: 1, maximum: 100, }, }, }, }, - src/index.ts:118-123 (registration)Registration of the get_streams tool in the main server switch statement, calling the handler with parsed arguments.
case 'get_streams': return await handleGetStreams(this.apiClient, { game: args.game as string | undefined, language: args.language as string | undefined, limit: args.limit as number | undefined });