get_clips
Retrieve Twitch clips from specific channels to analyze content performance or gather highlights for review and sharing.
Instructions
クリップの情報を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelName | Yes | Twitchチャンネル名 | |
| limit | No | 取得する最大クリップ数(デフォルト: 20) |
Implementation Reference
- src/tools/handlers/clip.ts:4-30 (handler)The handler function that fetches clips for the specified channel using Twitch API, resolves the broadcaster ID, retrieves clips, maps them to a simplified format, and returns formatted response.export async function handleGetClips( apiClient: ApiClient, args: { channelName: string; limit?: number } ) { const user = await getUserByName(apiClient, args.channelName); const clips = await apiClient.clips.getClipsForBroadcaster(user.id, { limit: args.limit }); return formatResponse( clips.data.map(clip => ({ id: clip.id, url: clip.url, embedUrl: clip.embedUrl, broadcasterId: clip.broadcasterId, broadcasterName: clip.broadcasterDisplayName, creatorId: clip.creatorId, creatorName: clip.creatorDisplayName, videoId: clip.videoId, gameId: clip.gameId, language: clip.language, title: clip.title, viewCount: clip.views, creationDate: clip.creationDate, thumbnailUrl: clip.thumbnailUrl, duration: clip.duration, })) ); }
- src/tools/definitions.ts:158-177 (schema)Tool definition including name, description, and input schema for validating arguments: channelName (required) and optional limit.{ name: 'get_clips', description: 'クリップの情報を取得します', inputSchema: { type: 'object', properties: { channelName: { type: 'string', description: 'Twitchチャンネル名', }, limit: { type: 'number', description: '取得する最大クリップ数(デフォルト: 20)', minimum: 1, maximum: 100, }, }, required: ['channelName'], }, },
- src/index.ts:136-140 (registration)Registration in the MCP server's CallToolRequestSchema handler switch statement, dispatching 'get_clips' calls to the handleGetClips function.case 'get_clips': return await handleGetClips(this.apiClient, { channelName: args.channelName as string, limit: args.limit as number | undefined });