Skip to main content
Glama

get_avatar_parameters

Retrieve a list of available parameters for the current avatar in VRChat, enabling precise control and customization through AI-driven interactions via MCP OSC.

Instructions

Get a list of parameters available on the current avatar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server.tool registration for 'get_avatar_parameters' tool, including the thin handler that delegates to avatarTools.getParameterNames()
    server.tool(
      'get_avatar_parameters',
      'Get a list of parameters available on the current avatar.',
      {},
      async (_, extra) => {
        try {
          const ctx = createToolContext(extra);
          const parameters = await avatarTools.getParameterNames(ctx);
          return { content: [{ type: 'text', text: JSON.stringify(parameters) }] };
        } catch (error) {
          return { 
            content: [{ 
              type: 'text', 
              text: `Error getting parameters: ${error instanceof Error ? error.message : String(error)}` 
            }],
            isError: true
          };
        }
      }
    );
  • AvatarTools.getParameterNames(): Main handler logic for retrieving avatar parameters, including retries, logging, validation, and fallback handling. Delegates to wsClient.getAvatarParameters()
    public async getParameterNames(ctx?: ToolContext): Promise<string[]> {
      if (ctx) {
        await ctx.info('Getting avatar parameters');
      }
      
      try {
        // Multiple retry attempts
        let attempts = 0;
        const maxAttempts = 3;
        let lastError: Error | null = null;
        
        while (attempts < maxAttempts) {
          attempts++;
          logger.info(`Getting avatar parameters (attempt ${attempts}/${maxAttempts})`);
          
          try {
            // Get the parameters with increased timeout
            const parameters = await this.wsClient.getAvatarParameters();
            
            // Validate the response
            if (!Array.isArray(parameters)) {
              throw new Error('Invalid parameter response: not an array');
            }
            
            // Return the list
            logger.info(`Found ${parameters.length} avatar parameters`);
            
            if (parameters.length > 0) {
              logger.debug(`Parameters: ${parameters.join(', ')}`);
            } else {
              logger.warn('No parameters found for current avatar');
            }
            
            if (ctx) {
              await ctx.info(`Found ${parameters.length} avatar parameters`);
              if (parameters.length <= 10 && parameters.length > 0) {
                await ctx.info(`Parameters: ${parameters.join(', ')}`);
              }
            }
            
            return parameters;
          } catch (error) {
            lastError = error instanceof Error ? error : new Error(String(error));
            logger.warn(`Attempt ${attempts} failed: ${lastError.message}`);
            
            // Wait before retry
            if (attempts < maxAttempts) {
              const delay = 500 * attempts; // Increasing delay for each retry
              logger.info(`Retrying in ${delay}ms...`);
              await new Promise(resolve => setTimeout(resolve, delay));
            }
          }
        }
        
        // All attempts failed
        if (lastError) {
          throw lastError;
        } else {
          throw new Error('Failed to get avatar parameters after multiple attempts');
        }
      } catch (error) {
        logger.error(`Failed to get avatar parameters: ${error instanceof Error ? error.message : String(error)}`);
        
        // Try to get parameters from the loaded config if we have it
        const fallbackParams = this.getFallbackParameters();
        
        if (ctx) {
          await ctx.warning(`Could not get avatar parameters: ${error instanceof Error ? error.message : String(error)}`);
          if (fallbackParams.length > 0) {
            await ctx.info(`Using ${fallbackParams.length} parameters from cached config`);
          }
        }
        
        return fallbackParams;
      }
    }
  • WebSocketClient.getAvatarParameters(): Low-level implementation that sends WebSocket request 'avatar/getParameters' to the relay server and processes the response into a string array.
    public async getAvatarParameters(): Promise<string[]> {
      try {
        // デバッグ用にリクエスト送信をログ
        this.logger.debug(`Requesting avatar parameters...`);
        
        const response = await this.sendRequest<{ parameters: string[] | Record<string, unknown> }>('avatar/getParameters');
        this.logger.debug(`Avatar parameters response: ${JSON.stringify(response)}`);
        
        // パラメータが配列の場合はそのまま返す
        if (Array.isArray(response?.parameters)) {
          this.logger.debug(`Avatar parameters: ${JSON.stringify(response.parameters)}`);
          return response.parameters;
        }
        
        // パラメータがオブジェクトの場合はキーの配列に変換
        if (response?.parameters && typeof response.parameters === 'object') {
          const parameterNames = Object.keys(response.parameters);
          this.logger.debug(`Avatar parameters (converted from object): ${JSON.stringify(parameterNames)}`);
          return parameterNames;
        }
        
        // パラメータが存在しないか無効な場合
        this.logger.warn('Invalid or missing parameters in response');
        return [];
      } catch (error) {
        this.logger.error(`Error getting avatar parameters: ${error instanceof Error ? error.message : String(error)}`);
        // Return empty array rather than throwing
        return [];
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation (implying read-only) but doesn't mention permissions, rate limits, error conditions, or what format the returned list has. For a tool with zero annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no annotations, and no output schema, the description provides the basic purpose but lacks important context about what the returned list contains, how it's structured, or any behavioral constraints. For a read operation that returns data, more detail about the output would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of parameters. The description appropriately doesn't add parameter information beyond what's in the schema, maintaining a baseline score of 4 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get a list') and resource ('parameters available on the current avatar'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_avatar_list' or 'set_avatar_parameter', which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_avatar_list' or 'set_avatar_parameter'. It mentions 'current avatar' but doesn't explain prerequisites or context for when this tool is appropriate versus other avatar-related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Krekun/vrchat-mcp-osc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server