get_avatar_list
Retrieve a list of available avatars in VRChat via the Model Context Protocol, enabling AI-assisted avatar selection and control in virtual environments.
Instructions
Get a list of available avatars.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- MCP tool registration and inline handler for 'get_avatar_list'. Fetches avatars via avatarTools.getAllAvatars() and returns JSON string.server.tool( 'get_avatar_list', 'Get a list of available avatars.', {}, async (_, extra) => { try { const ctx = createToolContext(extra); const avatars = await avatarTools.getAllAvatars(); return { content: [{ type: 'text', text: JSON.stringify(avatars) }] }; } catch (error) { return { content: [{ type: 'text', text: `Error getting avatar list: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
- Helper method getAllAvatars() in AvatarTools class that calls wsClient.getAvatarlist() to fetch the avatar list with logging and error handling./** * Get a list of all available avatars. * * @param ctx - MCP Context (optional) * @returns Promise resolving to an object with avatar IDs as keys and names as values */ public async getAllAvatars(ctx?: ToolContext): Promise<{ [avatarId: string]: string }> { if (ctx) { await ctx.info('Getting list of available avatars'); } try { const avatars = await this.wsClient.getAvatarlist(); if (ctx) { const avatarCount = Object.keys(avatars).length; await ctx.info(`Found ${avatarCount} available avatars`); } return avatars; } catch (error) { const errorMsg = `Error getting avatar list: ${error instanceof Error ? error.message : String(error)}`; this.logger.error(errorMsg); if (ctx) { await ctx.error(errorMsg); } return {}; } }