Skip to main content
Glama

get_voices_in_use

Retrieve currently active voice IDs across all VOICEVOX processes to monitor voice usage and prevent assignment conflicts.

Instructions

現在使用中の音声IDのリストを取得(全プロセス共通)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler implementation of getVoicesInUse. Acquires lock, reads shared state, cleans up old entries, and returns unique voice IDs currently in use across all processes.
    async getVoicesInUse(): Promise<number[]> {
      const locked = await this.acquireLock();
      if (!locked) {
        // ロックが取得できない場合でも読み取りは試みる
        const state = await this.readState();
        const cleanedState = this.cleanupOldEntries(state);
        return [...new Set(cleanedState.entries.map((e) => e.voiceId))];
      }
    
      try {
        let state = await this.readState();
        state = this.cleanupOldEntries(state);
        await this.writeState(state); // クリーンアップ後の状態を保存
    
        // 重複を除いた音声IDのリストを返す
        return [...new Set(state.entries.map((e) => e.voiceId))];
      } finally {
        await this.releaseLock();
      }
    }
  • src/index.ts:114-121 (registration)
    Tool registration defining the get_voices_in_use tool with its name, description (Japanese), and empty input schema.
    {
      name: "get_voices_in_use",
      description: "現在使用中の音声IDのリストを取得(全プロセス共通)",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:227-240 (registration)
    Case handler that routes get_voices_in_use tool calls to queue.getVoicesInUse() and formats the response with voices list and count.
    case "get_voices_in_use": {
      const voicesInUse = await queue.getVoicesInUse();
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              voicesInUse,
              count: voicesInUse.length,
            }, null, 2),
          },
        ],
      };
    }
  • Intermediate wrapper that calls sharedState.getVoicesInUse() with error handling and fallback to local queue voices.
    async getVoicesInUse(): Promise<number[]> {
      // 共有状態から全プロセスの使用中音声を取得
      try {
        return await this.sharedState.getVoicesInUse();
      } catch (error) {
        console.error("Failed to get voices in use:", error);
        // エラー時はローカルのキュー情報のみ返す
        const localVoices: number[] = [];
        if (this.currentTask) {
          localVoices.push(this.currentTask.voiceId);
        }
        this.tasks.forEach((task) => {
          localVoices.push(task.voiceId);
        });
        return [...new Set(localVoices)];
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It successfully discloses the global scope ('全プロセス共通'), which is critical behavioral context distinguishing it from session-specific tools. However, it omits safety characteristics (read-only nature, idempotency), error conditions, or performance implications that would be essential for a state-querying tool without annotation coverage.

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 Japanese sentence with zero wasted words. It front-loads the action and resource, placing the scope qualifier parenthetically. Every element earns its place: the verb (取得), the resource (音声IDリスト), the state filter (現在使用中), and the scope disambiguator (全プロセス共通).

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

Completeness4/5

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

Given the low complexity (zero parameters, simple getter function) and absence of an output schema, the description adequately explains the return value conceptually (a list of voice IDs). It is complete enough for an agent to select and invoke correctly, though explicit mention of error states or empty result handling would elevate it to a 5.

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 input schema contains zero parameters. Per the calibration rules for 0-param tools, the baseline score is 4. The description does not need to compensate for missing parameter documentation, and none are present to describe.

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

Purpose5/5

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

The description uses specific verb '取得' (get/retrieve) and clearly identifies the resource as '現在使用中の音声IDのリスト' (list of currently in-use voice IDs). The parenthetical '(全プロセス共通)' (common across all processes) effectively distinguishes this from the sibling tool get_session_voice by explicitly stating its global scope.

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

Usage Guidelines3/5

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

The description implies usage context through the 'all processes' scope qualifier, suggesting when to use this versus session-specific alternatives. However, it lacks explicit guidance on when-not-to-use or direct comparison to siblings like get_session_voice or list_voices.

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

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/arrow2nd/vv-mcp'

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