get_global_badges
Retrieve the list of global chat badges available on Twitch to identify and display user achievements and status indicators.
Instructions
グローバルチャットバッジのリストを取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/handlers/chat.ts:20-37 (handler)The handler function that implements the core logic of the 'get_global_badges' tool. It retrieves global chat badges from the Twitch API and formats them into a structured response with badge IDs and version details including titles and image URLs.export async function handleGetGlobalBadges(apiClient: ApiClient) { const badges = await apiClient.chat.getGlobalBadges(); return formatResponse( badges.map(badge => ({ id: badge.id, versions: Object.fromEntries( badge.versions.map(version => [ version.id, { title: version.title, imageUrl: version.getImageUrl(1), }, ]) ), })) ); }
- src/tools/definitions.ts:132-139 (schema)The schema definition for the 'get_global_badges' tool, specifying its name, description, and input schema (empty object since no parameters are required). This is part of the toolDefinitions array used for MCP tool listing.{ name: 'get_global_badges', description: 'グローバルチャットバッジのリストを取得します', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:128-129 (registration)Registration of the tool handler in the main CallToolRequestSchema switch statement, dispatching calls to 'get_global_badges' to the handleGetGlobalBadges function.case 'get_global_badges': return await handleGetGlobalBadges(this.apiClient);
- src/index.ts:19-19 (registration)Import statement bringing in the handleGetGlobalBadges handler function for use in the MCP server.import { handleGetGlobalEmotes, handleGetGlobalBadges } from './tools/handlers/chat.js';