vrchat_select_avatar
Switch to a specific avatar in VRChat by providing its unique ID. This tool enables avatar selection through the VRChat API.
Instructions
Select and switch to a specific avatar by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| avatarId | Yes | The ID of the avatar to select |
Implementation Reference
- src/tools/avatars.ts:14-32 (handler)The asynchronous handler function that authenticates the VRChat client, selects the avatar by ID, and returns the response or an error message.async (params) => { try { await vrchatClient.auth() const response = await vrchatClient.avatarApi.selectAvatar(params.avatarId) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } } catch (error) { return { content: [{ type: 'text', text: 'Failed to select avatar: ' + error }] } } }
- src/tools/avatars.ts:11-13 (schema)Zod input schema defining the 'avatarId' parameter as a string.{ avatarId: z.string().describe('The ID of the avatar to select'), },
- src/tools/avatars.ts:7-33 (registration)Registers the 'vrchat_select_avatar' tool on the MCP server with name, description, input schema, and handler function.// Name 'vrchat_select_avatar', // Description 'Select and switch to a specific avatar by its ID.', { avatarId: z.string().describe('The ID of the avatar to select'), }, async (params) => { try { await vrchatClient.auth() const response = await vrchatClient.avatarApi.selectAvatar(params.avatarId) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } } catch (error) { return { content: [{ type: 'text', text: 'Failed to select avatar: ' + error }] } } } )
- src/main.ts:31-31 (registration)Calls createAvatarsTools during server initialization, which registers the vrchat_select_avatar tool among others.createAvatarsTools(server, vrchatClient)