search_categories
Find Twitch game categories using search keywords to organize streams and content discovery.
Instructions
ゲームやカテゴリーを検索します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 検索キーワード | |
| limit | No | 取得する最大カテゴリー数(デフォルト: 20) |
Implementation Reference
- src/tools/handlers/game.ts:30-43 (handler)The handler function that performs the search for categories using the Twitch API client and returns formatted results.export async function handleSearchCategories( apiClient: ApiClient, args: { query: string; limit?: number } ) { const categories = await apiClient.search.searchCategories(args.query, { limit: args.limit }); return formatResponse( categories.data.map(category => ({ id: category.id, name: category.name, boxArtUrl: category.boxArtUrl, })) ); }
- src/tools/definitions.ts:61-80 (schema)The input schema definition for the search_categories tool, specifying required query parameter and optional limit.{ name: 'search_categories', description: 'ゲームやカテゴリーを検索します', inputSchema: { type: 'object', properties: { query: { type: 'string', description: '検索キーワード', }, limit: { type: 'number', description: '取得する最大カテゴリー数(デフォルト: 20)', minimum: 1, maximum: 100, }, }, required: ['query'], }, },
- src/index.ts:106-110 (registration)The switch case in the main server request handler that routes calls to the search_categories tool to its handler function.case 'search_categories': return await handleSearchCategories(this.apiClient, { query: args.query as string, limit: args.limit as number | undefined });
- src/index.ts:17-17 (registration)Import statement that brings in the handleSearchCategories handler function for use in the server.import { handleGetTopGames, handleGetGame, handleSearchCategories } from './tools/handlers/game.js';