get_videos
Retrieve video content from Twitch channels to access broadcasts and clips. Specify a channel name to fetch videos with configurable limits for content management.
Instructions
チャンネルのビデオを取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelName | Yes | Twitchチャンネル名 | |
| limit | No | 取得する最大ビデオ数(デフォルト: 20) |
Implementation Reference
- src/tools/handlers/video.ts:5-29 (handler)The handler function that implements the core logic for fetching videos from a Twitch channel using the ApiClient, formatting the response with video details.export async function handleGetVideos( apiClient: ApiClient, args: { channelName: string; limit?: number } ) { const user = await getUserByName(apiClient, args.channelName); const videos = await apiClient.videos.getVideosByUser(user.id, { limit: args.limit }); return formatResponse({ total: videos.data.length, videos: videos.data.map(video => ({ id: video.id, title: video.title, description: video.description, url: video.url, thumbnailUrl: video.thumbnailUrl, viewCount: video.views, creationDate: video.creationDate, duration: video.duration, language: video.language, type: video.type, publishDate: video.publishDate, mutedSegments: video.mutedSegmentData, })), }); }
- src/tools/definitions.ts:192-211 (schema)The tool definition including name, description, and input schema for validating arguments (channelName required, optional limit).{ name: 'get_videos', description: 'チャンネルのビデオを取得します', inputSchema: { type: 'object', properties: { channelName: { type: 'string', description: 'Twitchチャンネル名', }, limit: { type: 'number', description: '取得する最大ビデオ数(デフォルト: 20)', minimum: 1, maximum: 100, }, }, required: ['channelName'], }, },
- src/index.ts:147-151 (registration)Tool registration in the CallToolRequestSchema handler switch statement, dispatching to the handleGetVideos function.case 'get_videos': return await handleGetVideos(this.apiClient, { channelName: args.channelName as string, limit: args.limit as number | undefined });